Thanks a lot, Phil and Linuxuser for your prompt reply.
Yes, it is tricky and I use it from a Java program with "Runtime.getRuntime().exec(exiftool_command);"
I have dirs with a mixture of NEF and JPG original files and I need to get 256x256 thumbnails of them with the right orientation.
The jpg files I get with this code are intermediate to get 256x256 pixels thumbnails with "mogrify", so after I need to delete those intermediate .nef.jpg
Phil, I am going to test your proposal with needed variations, I will let you know about, sure :-)
Linuxuser, you had a nice idea, I use nef.jpg to be able to differentiate them from original jpg, but it could be also just .JPEG so I will not need a double extension.
I will comeback as soon as I have some results after testing with these new possibilities.
Phil, thanks a lot for this very nice exiftool. I will let you know about my program for photography classification.
My best regards.
P.D. Escuse me about my english, I am from Spain :-)
I think I have found the coding solution for my program, I am very happy :-))
"exiftool -b -previewimage -w jpeg -ext nef . -execute -overwrite_original -tagsfromfile %d%f.nef -Orientation -ext jpeg ."
I made test with nef files but it will be like: cr2, raf, rw2, jpg as original from cameras.
With this one a get the previewimage of any raw file with the right orientation tag in it and with JPEG extension, so I can delete JPEGs after "mogrify" reduced them to PNG with 256x256 pixels without afecting originals jpg in the same dir.
Thanks a lot Phil and Linuxuser, both have guide me to the nice solution.
Muchisimas gracias :-)
My best regards.
P.D. I will keep you inform about my photo clasification system that is universal because it only use pure text files to keep photo tags and Java.