Created
June 12, 2012 09:54
-
-
Save deltheil/2916633 to your computer and use it in GitHub Desktop.
JPEG images: EXIF orientation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1/ Read EXIF orientation flag | |
identify -format "%[EXIF:orientation]" myimage.jpg | |
# NOTE: jhead can be used too | |
# see http://www.sentex.net/~mwandel/jhead/ | |
jhead -exifmap myimage.jpg | grep Ori | |
# 2/ Remove EXIF orientation | |
# i.e. rotate the image accordingly and reset the orientation | |
# flag to 1 (default, i.e. origin = TopLeft) | |
# WARNING: the image file is overwritten! | |
# NOTE: it also works with a wildcard: jhead -autorot *.jpg | |
jhead -autorot myimage.jpg | |
# NOTE: to simply reset the orientation flag w/o applying any | |
# rotation, use the -norot option instead | |
jhead -norot myimage.jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment