Have you encountered issues where an image you shared, uploaded, or synced ended up with the wrong orientation?
Short solution: install jhead
and run the command below on the image in question.
$ jhead -autorot image.jpg
The reason why an image could be oriented one way, then oriented in another when uploaded, viewed, shared, etc. has to do with EXIF metadata stored in the image. This orientation flag has one of eight values: 0 degrees, 90 degrees, 180 degrees, and 270 degrees, as well as mirror flip counterparts. Most modern software can read this orientation flag to correctly show the photo with its proper orientation; however, problems occur when software is unable to read this orientation flag.
Jhead is a tool that allows you to edit an image's EXIF metadata via the command-line. It's lightweight, fast, opensource, and my preferred method of fixing pesky EXIF issues quickly.
Other tools to checkout include:
- Exiftool - despite the dated looking website, this is also an excellent tool.