identify -format fails

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
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

identify -format fails

Post by Drarakel »

It seems, that an "identify -format %A" alone (for checking whether there's an alpha channel) doesn't read the image anymore correctly?

Code: Select all

convert logo: -transparent white logo.png
identify -format "%A" logo.png
False

The above worked in older IM versions, but not with the current version.
However, when combined with other properties, it's ok:

Code: Select all

identify -format "%A\n%r" logo.png
True
DirectClassRGBMatte

(By the way, it should be PseudoClass here, not DirectClass.)
Using ImagMagick v6.6.7-10 Q16, Windows XP.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: identify -format fails

Post by magick »

We can reproduce the problem you posted and have a patch in ImageMagick 6.6.8-0 Beta (available by sometime tomorrow). Thanks.
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: identify -format fails

Post by Drarakel »

Works now. Thanks!
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: identify -format fails

Post by Drarakel »

Another small thing.. 'identify -format "%x %y"' sometimes fails, too - at least with PNG files. Example - take this file:
http://img651.imageshack.us/img651/5595/rosebc.png

Code: Select all

identify -verbose rosebc.png
...
Resolution: 456x456
Units: PixelsPerInch
...

Code: Select all

identify -format "%[xresolution]x%[yresolution]" rosebc.png
456x456
But with the next command, only the IM default value gets reported:

Code: Select all

identify -format "%x x %y" rosebc.png
72 Undefined x 72 Undefined
But it works with "+ping":

Code: Select all

identify +ping -format "%x x %y" rosebc.png
456 PixelsPerInch x 456 PixelsPerInch
Or without +ping, but with an additional 'property': :wink:

Code: Select all

identify -format "%x x %y\n%[version]" rosebc.png
456 PixelsPerInch x 456 PixelsPerInch
ImageMagick 6.6.8-2 2011-03-06 Q16 http://www.imagemagick.org

Seems that all of the tEXt/zTXt chunks in PNG are affected.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: identify -format fails

Post by glennrp »

Yes, a recent patch involving the PNG text:density chunk inadvertently
suppressed all of the text chunks. Should be OK now in IM-6.6.8-4, SVN r3845.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: identify -format fails

Post by glennrp »

How was the file "rosebc.png" created? It contains a text:density chunk and a text:units chunk,
and is missing some of the chunks usually written by ImageMagick.
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: identify -format fails

Post by Drarakel »

I created the chunks manually (with TweakPNG).
Thanks for the new patch!
Post Reply