-strip on certain images loses rotation information

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
pyramation
Posts: 9
Joined: 2014-01-29T11:33:12-07:00
Authentication code: 6789

-strip on certain images loses rotation information

Post by pyramation »

I've noticed that some images lose rotation information when I use -strip. Is there a way to rotate an image based on it's information, then strip it after?

For example, this causes the image to be the wrong orientation:

Code: Select all

convert DSC_0551.JPG -strip stripped.jpg
pyramation
Posts: 9
Joined: 2014-01-29T11:33:12-07:00
Authentication code: 6789

Re: -strip on certain images loses rotation information

Post by pyramation »

Also, I just looked at the exif data, and found this:

Code: Select all

identify -format "%[EXIF:*]" DSC_0551.JPG
which gave this info:

Code: Select all

exif:Orientation=6
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: -strip on certain images loses rotation information

Post by dlemstra »

You can do the following:

Code: Select all

convert DSC_0551.JPG -auto-orient -strip stripped.jpg
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
pyramation
Posts: 9
Joined: 2014-01-29T11:33:12-07:00
Authentication code: 6789

Re: -strip on certain images loses rotation information

Post by pyramation »

Thanks! I actually had notes in my codebase saying not to us -auto-orient, but looks like it was due to a bug that was fixed (viewtopic.php?f=3&t=24749)

That did the trick!
Post Reply