Extract non-Exif orientation data from JPEG?
Posted: 2013-07-17T19:07:36-07:00
Hi,
I have a JPEG that has orientation data in it, but it doesn't seem to be stored in the image's Exif data. If I run the image through convert with -auto-orient, it rotates the image, and "identify -verbose" is also able to extract the orientation:
but neither of these commands produces any output when run:
The image in question is available here: http://wootangent.net/~lsd/blah/0000221676_0.jpg
I'm doing this as part of the image upload flow in a website, so I'd like to avoid the cost of running "identify -verbose" if possible. Is there another way to get the orientation information from images like this?
I have a JPEG that has orientation data in it, but it doesn't seem to be stored in the image's Exif data. If I run the image through convert with -auto-orient, it rotates the image, and "identify -verbose" is also able to extract the orientation:
Code: Select all
identify -verbose 0000221676_0.jpg | grep Orientation
Orientation: RightTop
Code: Select all
identify -format '%[EXIF:Orientation]' 0000221676_0.jpg
identify -format '%[IPTC:2:131]' 0000221676_0.jpg
I'm doing this as part of the image upload flow in a website, so I'd like to avoid the cost of running "identify -verbose" if possible. Is there another way to get the orientation information from images like this?