If you take a JPEG picture in a non-native orientation for the CCD, most cameras don't bother rotating the raw image. They just (lazily) modify the Orientation value in the EXIF metadata and make the image viewer deal with it. You can check this value by installing ExifTool (via APT) and running exiftool -Orientation -n image.jpg
. (This will give you the raw number value found in the data, for a human-readable output remove the -n
.)
Is there an Ubuntu/Linux tool or way to modify a JPEG image so that the raw image is rotated to the correct orientation when the EXIF orientation value is set to 1?
I think you want ImageMagick’s auto-orient feature. So, for one image:
convert input.jpg -auto-orient result.jpg
Or, if you have lots to do, make a backup first, then:
mogrify -auto-orient *.jpg
Note this will alter all your files irreversibly, so backup first and check it’s what you want.