Search code examples
image-processingimagemagickgraphicsmagick

Does GraphicsMagick have an equivalent to ImageMagick 'convert -auto-orient' option?


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


Solution

  • 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="";;