Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect EXIF Orientation and Rotate Image using ImageMagick

Canon DSLRs appear to save photos in landscape orientation and uses exif::orientation to do the rotation.

Question: How can imagemagick be used to re-save the image into the intended orientation using the exif orientation data such that it no longer requires the exif data to display in the correct orientation?

like image 731
Nyxynyx Avatar asked Oct 18 '13 17:10

Nyxynyx


1 Answers

Use the auto-orient option of ImageMagick's convert to do this.

convert your-image.jpg -auto-orient output.jpg 

Or use mogrifyto do it in place

mogrify -auto-orient your-image.jpg 
like image 119
dlemstra Avatar answered Sep 22 '22 06:09

dlemstra