Search code examples
imagemagickorientationexifexiv2

Can't set image orientation with ImageMagick


I'm trying to set a JPEG file's image orientation in ImageMagick, but not seeing any visible changes.

In PHP via the Imagick library, something like this seems to have no effect on the image written out:

$image->setImageOrientation( 8 );  // 8 == imagick::ORIENTATION_BOTTOMRIGHT

I can detect no difference in the image created with ImageMagick's identify, nor with exiv2.

And convert and mogrify don't seem to help either. I try commands like:

mogrify -orient BottomRight test.jpg

And see no effect.

However, exiv2 does seem to be able to modify the orientation, and the Mac desktop even updates the thumbnail immediately. Unfortunately in the environment I want to use, I won't have exiv2.

I assume ImageMagick doesn't have these features for no reason... what am I doing wrong?


Solution

  • Which version of ImageMagick do you use? This looks like a bug, fixed in version 6.6.3-4, see this discussion:

    http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=16795#p62108