Page 1 of 1
convert -auto-orient
Posted: 2011-06-15T05:58:39-07:00
by Torava
Hello!
I have tried to fix my pictures' orientation using convert command with no luck. identify command tells me that in my picture's orientation is undefined and exif orientation is some value. convert img.jpg -auto-orient only changes exif orientation to 0, but doesn't have effect on image. Using jhead -autorot img.jpg I get my pictures fixed and it sets exif orientation to 1, but I would like to use convert. Why this isn't possible to do with convert command?
I have ImageMagick 6.3.7.
Re: convert -auto-orient
Posted: 2011-06-15T10:10:32-07:00
by fmw42
I cannot say what is going on but your version of IM is about 350 version old. Perhaps you should upgrade and try again.
Re: convert -auto-orient
Posted: 2011-06-15T18:23:06-07:00
by anthony
Did you actually save the image? What was your command line?
See IM examples, Photo handling, Digital Photo Orientation
http://www.imagemagick.org/Usage/photos/#orient
Re: convert -auto-orient
Posted: 2011-06-16T02:17:47-07:00
by Torava
I have saved many images using convert command. None of those have even been oriented. I have used PHP and PuTTY. Using PHP I resize images and save them to cache directory and want them to be oriented correctly.
fmw42 wrote:I cannot say what is going on but your version of IM is about 350 version old. Perhaps you should upgrade and try again.
I have no permissions to update ImageMagick so I have to wait until my host will do it.
Other question: What do you suggest if I want to name my resized images by new width? Like img_150px.jpg. Can I do that in one line?
Re: convert -auto-orient
Posted: 2011-06-16T10:31:03-07:00
by fmw42
With your old version, not so easy. With a newer version you can use -set filename to get the image size and then use it in your output name.
something like:
convert image -set filename:mywidth "%[fx:w]" output_%[filename:mywidth].jpg
eg
convert rose: -set filename:mywidth "%w" rose_%[filename:mywidth].jpg
For older systems:
convert rose: rose_$(convert rose: -format "%w" info:).jpg
Re: convert -auto-orient
Posted: 2011-06-16T17:21:27-07:00
by anthony
NOTE: thumbnail images, either in the image as a preview, or already generated and stored by the operating system, will be affected by the rotation correction. As such you may not see it with a quick overview.
Also I do not recommend saving JPEG images back to JPEG! as you will get some distortion of image data every time you re-save to JPEG. It is a good format for disk space and web downloads, a bad format for preserving the image data.