"auto-orient" + "flatten"

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
doublemax
Posts: 6
Joined: 2015-12-02T14:38:27-07:00
Authentication code: 1151

"auto-orient" + "flatten"

Post by doublemax »

Testcase (result should be 'landscape'):

Code: Select all

wget https://raw.githubusercontent.com/recurser/exif-orientation-examples/master/Landscape_5.jpg
/usr/local/bin/convert -auto-orient "Landscape_5.jpg" -flatten "result.png"
Other examples from this list work fine.
ImageMagick 6.9.2-7

Thanks!
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: "auto-orient" + "flatten"

Post by Bonzo »

Are the good images and bad images from the same camera etc. Different cameras can write different data to the image or none at all.

Have you checked the image data with -identify -verbose?

What happens without the -flatten?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: "auto-orient" + "flatten"

Post by fmw42 »

try putting -auto-orient after the input image.
doublemax
Posts: 6
Joined: 2015-12-02T14:38:27-07:00
Authentication code: 1151

Re: "auto-orient" + "flatten"

Post by doublemax »

Same, orientation-flag-example is wrong:

Code: Select all

wget https://raw.githubusercontent.com/recurser/exif-orientation-examples/master/Landscape_5.jpg
/usr/local/bin/convert "Landscape_5.jpg" -auto-orient -flatten "result.png"
From this list all the images work but the "5s" and the "7s":
https://github.com/recurser/exif-orientation-examples

Thanks a lot
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: "auto-orient" + "flatten"

Post by dlemstra »

Why do you need the -flatten? It works perfectly without that extra unnecessary option.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
doublemax
Posts: 6
Joined: 2015-12-02T14:38:27-07:00
Authentication code: 1151

Re: "auto-orient" + "flatten"

Post by doublemax »

Input images are user-uploaded image files.
They can have layers - and I want a generic commandline (any uploaded image should become a PNG/JPG image)
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: "auto-orient" + "flatten"

Post by dlemstra »

Adding +repage after -auto-orient seems to resolve the issue.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
doublemax
Posts: 6
Joined: 2015-12-02T14:38:27-07:00
Authentication code: 1151

Re: "auto-orient" + "flatten"

Post by doublemax »

You are right - sorry for disturbing.
Post Reply