-auto-orient not updating Exif

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
blackrosegul
Posts: 1
Joined: 2013-05-02T02:39:29-07:00
Authentication code: 6789

-auto-orient not updating Exif

Post by blackrosegul »

So if I use -auto-orient command, it properly flips the image and viewing with a desktop browser the picture displays properly, but now if if I view the same picture using an iPhone the picture is sideways.

The problem I think is that after I run the -auto-orient command the Exif data is not updated. The original picture Exif shows Right/Top where the Exif data after using the -auto-orient should have been updated to show Top/Left.

Is there any way to update the Exif data when the -auto-orient command is issued?
GuL
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: -auto-orient not updating Exif

Post by anthony »

Spilt post to new topic in 'bugs' forum, rather than reserect a very old topic by the same name.

Current examples for Photo Orientation handling
http://www.imagemagick.org/Usage/photos/#orient


Basically the question is if you set the properity "exif:orientation" does it also change the orientation in the profile.

After my work for IMv7 settings, I know that this may not be the case. So to test EXIT profiles properly it is best to save the image, then look at the image in a seperate command, just to be sure.

Quick test shows the EXIF orientation in the profile is being updated when it is modified.

Code: Select all

convert pagoda_sm.jpg -rotate 180 -orient bottom-right jpg:- | 
  convert -   -print 'orientation=%[exif:orientation]\n' null:
orientation=3
Here I read in a photo I know has EXIF data. The photo is oriented correctly, so rotated it upside down, then set the orientation to reflect this rotation.

The second command then looks to see if the EXIF orientation is showing this 'new orientation. It is.

Okay now lets 'auto-orient' and look again, again using seperate commands.

Code: Select all

convert pagoda_sm.jpg -rotate 180 -orient bottom-right jpg:- |
   convert - -auto-orient show:
image was correctly restored to the right rotation. So lets look at the resulting orientation

Code: Select all

convert pagoda_sm.jpg -rotate 180 -orient bottom-right jpg:- |
   convert - -auto-orient jpg:- |
     convert -   -print 'orientation=%[exif:orientation]\n' null:
orientation=1
Yeap... all is good. image's EXIF orientation is correct.


What version of IM do you have. perhaps it is anchient?

Could there be a 'photoshop' profile in it? photoshop tends to use its own profile rather than EXIF when avalable.

WARNING: JPEG is a lossy image file format, you should not do as I did above for production images, as every save to JPEG reduces the images quality. I only did the above for testing purposes.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply