3

I want to move to GraphicsMagick because I'm only resizing and rotating photos, and I heard it was a little faster. But it doesn't take the -auto-orient option directly. Is there another way to do this efficiently? The Imagemagick convert -auto-orient option will read the EXIF orientation tag, rotate accordingly, then RESET the EXIF tag to orientation=1.

see: http://www.imagemagick.org/script/command-line-options.php?ImageMagick=80iu7ek6jb638dl2kin7n3v4d5#auto-orient

michael
  • 4,377
  • 8
  • 47
  • 73

2 Answers2

8

Version 1.3.18 of GraphicsMagick (released March 10, 2013) added support for the -auto-orient parameter on the 'convert' tool.

Quote from GraphicsMagick News page: "convert/mogrify: Now support -auto-orient to automatically rotate the image upright"

Mister_Tom
  • 1,500
  • 1
  • 23
  • 36
julesj
  • 754
  • 4
  • 10
2

Not at this time.

As you said, you can guess the operation to accomplish with a simple switch case. This is taken from an interesting resource page: http://sylvana.net/jpegcrop/exif_orientation.html

switch EXIF:Orientation:
  1) transform="";;
  2) transform="-flip horizontal";;
  3) transform="-rotate 180";;
  4) transform="-flip vertical";;
  5) transform="-transpose";;
  6) transform="-rotate 90";;
  7) transform="-transverse";;
  8) transform="-rotate 270";;
  *) transform="";;
Olivier Amblet
  • 723
  • 3
  • 16
  • 1
    thx. but the imagemagick -auto-orient option also edits the EXIF data to reset the EXIF orientation tag to orientation=1. This method just rotates the photo without updating the tag. – michael Aug 04 '11 at 06:10
  • 1
    graphicksmagick doesn't have transpose and transverse (imagemagick does). Instead, use the following for 5 and 7: `-flop -rotate 270`, `-flop -rotate 90` (see http://www.graphicsmagick.org/convert.html – Michael Rush Oct 16 '13 at 21:29