Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 828
michael Avatar asked Dec 19 '25 05:12

michael


2 Answers

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"

like image 168
julesj Avatar answered Dec 20 '25 19:12

julesj


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="";;
like image 43
Olivier Amblet Avatar answered Dec 20 '25 17:12

Olivier Amblet



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!