Extract OtherImage from NEF with proper orientation

Started by bruno-m, November 30, 2017, 06:40:21 AM

Previous topic - Next topic

bruno-m

Hi to all.
Phil Harvey, thank you for ExifTool, you made great app.

In my work I must shoot in two formats - NEF and JPG. JPG must be only monitor sized, 1620x1080, but Nikon can only shoot in full JPG 6016x4016.
Thanks to ExifTool, I found that in NEF file there is OtherImage JPG 1620x1080, perfect for me.
But after extract there is a problem - JPG is only horizontal after extracting. I see that camera write in exif info about orientation, eg Rotate 90 CW.

Can exiftool extract OtherImage with proper orientation? Or maybe there is script, that can read orientation from NEF file, and change JPG?
I shoot many photo, 10,000-15,000 for weekend - it is hard to change every JPG manually.

And second question - I use exiftool -b -OtherImage -w .jpg -ext nef D:\photo-triumf, how I can extract JPG to different folder?

Thank you for answers!

Phil Harvey

Try this:

1. exiftool -b -OtherImage -w DIFFERENT_FOLDER/%f.jpg -ext nef D:/photo-triumf

2. exiftool -tagsfromfile @ -orientation -srcfile DIFFERENT_FOLDER/%f.jpg -ext nef D:/photo-triumf

The 2nd command copies the Orientation tag from the NEF to the JPG, and is a bit tricky because it uses the -srcfile option to write the JPG files instead of the NEF's.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

bruno-m

Thank you, works great!

Second command after orientation copy make another file near JPG, 66513.jpg_original
It is original of jpg, before orientation copy. It is not necessary for me, I don't need original. Maybe there is command that leaves only one JPG?

Phil Harvey

Add -overwrite_original to the second command to avoid preserving the original file.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).