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.
convert -auto-orient
convert -auto-orient
Last edited by Torava on 2011-06-15T10:54:40-07:00, edited 2 times in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert -auto-orient
I cannot say what is going on but your version of IM is about 350 version old. Perhaps you should upgrade and try again.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: convert -auto-orient
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
See IM examples, Photo handling, Digital Photo Orientation
http://www.imagemagick.org/Usage/photos/#orient
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: convert -auto-orient
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.anthony wrote: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
I have no permissions to update ImageMagick so I have to wait until my host will do it.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.
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?
Last edited by Torava on 2011-06-18T04:59:35-07:00, edited 2 times in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert -auto-orient
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
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
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: convert -auto-orient
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.
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/