I have a lot of photos taken with an iPhone SE that are not displayed in the correct orientation when I view them using the Windows Photos app, XnView MP, or FastStone Image Viewer. I never modified these photos when they were on the iPhone or after I transferred them to my PC.
There are numerous answers on StackExchange (just a few examples: here, here, here) saying that you can use Jhead with the -autorot
option to automatically correct the orientation of your photos based on the EXIF orientation field.
So I tried using Jhead 3.04 with jpegtran on Windows. Before running Jhead, I made backup copies of the photos and also ran ExifTool on a couple of the photos and saved the output. Then I ran jhead -autorot *.jpg
on the photos.
When I viewed the modified photos in the Windows Photos app, XnView MP, and FastStone Image Viewer, they were all still displayed in the same incorrect orientation as before.
Then I ran ExifTool on one of the modified photos as well as the backup copy, and compared the outputs. These are the EXIF fields that Jhead changed:
- Orientation changed from "Rotate 90 CW" to "Horizontal (normal)"
- Thumbnail Length changed from 12925 to 11906
- Image Width changed from 4032 to 3024
- Image Height changed from 3024 to 4032
- Image Size changed from 4032x3024 to 3024x4032
- Thumbnail Image changed from "(Binary data 12925 bytes, use -b option to extract)" to "(Binary data 11906 bytes, use -b option to extract)"
I also diffed the modified photo with the backup copy, and Jhead also changed the photo data itself in addition to the EXIF data.
Then I tried Jhead with the -norot
option to see what would happen. After running jhead -norot *.jpg
on another set of backup copies of the photos, the photos were all displayed in the correct orientation in Windows Photos, XnView MP, and FastStone Image Viewer.
Again I ran ExifTool on the same photo as before, comparing the outputs for the modified one and the backup copy. Only one EXIF field was changed by Jhead using the -norot
option:
- Orientation changed from "Rotate 90 CW" to "Horizontal (normal)"
And diffing the modified photo with the backup copy showed that only that EXIF field changed, none of the photo data was changed.
So why is it that using Jhead with the -autorot
option is a highly recommended way to automatically correct photo orientation, but it doesn't work for me, and I have to use the -norot
option instead?