How to find out if a *.jpg is currently rotated?
Posted: 2019-06-25T14:22:58-07:00
Many cameras create a photo file with originally portrait orientation by
capturing it pyhsically in landscape mode and create header tag that it is rotated by 90 (or 270 deg).
When such a *.jpg file is opened in a (most) picture viewer, then the picture viewer reads at first the orientation header tag and displays the photo in correct view.
Now, how can I read with ImageMagick from (DOS batch) script file the orientation value from *.jpg header?
Later I want to implement something like
set orient = convert -showorientation mysample.jpg
if orient=90 (jpegtran -rotate 270 mysample.jpg mysampleout.jpg)
In other words: I want to convert the virtual orientation into a physical one.
What I need is the ImageMagick command to get the orientation angle from Jpg header.
Thank you
Ben
capturing it pyhsically in landscape mode and create header tag that it is rotated by 90 (or 270 deg).
When such a *.jpg file is opened in a (most) picture viewer, then the picture viewer reads at first the orientation header tag and displays the photo in correct view.
Now, how can I read with ImageMagick from (DOS batch) script file the orientation value from *.jpg header?
Later I want to implement something like
set orient = convert -showorientation mysample.jpg
if orient=90 (jpegtran -rotate 270 mysample.jpg mysampleout.jpg)
In other words: I want to convert the virtual orientation into a physical one.
What I need is the ImageMagick command to get the orientation angle from Jpg header.
Thank you
Ben