Non-standard behavior of identify *.png

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
wkoszek
Posts: 9
Joined: 2015-11-16T19:30:51-07:00
Authentication code: 1151

Non-standard behavior of identify *.png

Post by wkoszek »

Hello,

Thanks for Image Magick. It's a great suite and I use it nearly every day.

Bug report:

All UNIX utilities whom one can feed with multiple file-names for processing perform the very same operation/reporting. Example:

Code: Select all

wkoszek:/tmp/imagemagick> file *.png
b1.png: PNG image data, 1000 x 1000, 1-bit grayscale, non-interlaced
b2.png: PNG image data, 1000 x 1000, 1-bit grayscale, non-interlaced
b3.png: PNG image data, 1000 x 1000, 1-bit grayscale, non-interlaced
w1.png: PNG image data, 1000 x 1000, 1-bit grayscale, non-interlaced
w2.png: PNG image data, 1000 x 1000, 1-bit grayscale, non-interlaced
w3.png: PNG image data, 1000 x 1000, 1-bit grayscale, non-interlaced
Example 2:

Code: Select all

wkoszek:/tmp/imagemagick> du *.png
4	b1.png
4	b2.png
4	b3.png
4	w1.png
4	w2.png
4	w3.png
identify breaks this convention, which makes scripting harder:

Code: Select all

wkoszek:/tmp/imagemagick> identify *.png
b1.png PNG 1000x1000 1000x1000+0+0 8-bit sRGB 2c 393B 0.000u 0:00.000
b2.png[1] PNG 1000x1000 1000x1000+0+0 8-bit sRGB 2c 393B 0.000u 0:00.000
b3.png[2] PNG 1000x1000 1000x1000+0+0 8-bit sRGB 2c 393B 0.000u 0:00.000
w1.png[3] PNG 1000x1000 1000x1000+0+0 8-bit sRGB 2c 701B 0.000u 0:00.000
w2.png[4] PNG 1000x1000 1000x1000+0+0 8-bit sRGB 2c 701B 0.000u 0:00.000
w3.png[5] PNG 1000x1000 1000x1000+0+0 8-bit sRGB 2c 701B 0.000u 0:00.000
I think numbering of the files should be removed.

Please confirm this bug.

PS: Your website http://www.imagemagick.org/script/index.php lists on the bottom the site http://git.imagemagick.org/repos/ImageMagick/issues as a bug database, but I don't see a way to login there. It'd be much simpler if ImageMagick lived on GitHub / gitlab.com.

Wojciech Koszek
wojciech@koszek.com
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Non-standard behavior of identify *.png

Post by dlemstra »

This is a design choice and not a bug. You can however get what you want with the -format option. This can even make it easier for yourself to parse the output. Below is an example:

Code: Select all

wkoszek:/tmp/imagemagick> identify -format "%wx%h %f\n" *.png
1000x1000 b1.png
1000x1000 b2.png
1000x1000 b3.png
1000x1000 w1.png
1000x1000 w2.png
1000x1000 w3.png
And we are on gitlab and gitbub:
https://gitlab.com/ImageMagick/ImageMagick
https://github.com/ImageMagick/ImageMagick
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
wkoszek
Posts: 9
Joined: 2015-11-16T19:30:51-07:00
Authentication code: 1151

Re: Non-standard behavior of identify *.png

Post by wkoszek »

Hello,

Thanks. I was surprised this behavior isn't the default.

BTW, http://git.imagemagick.org <- this is linked from the home-page. If you use a password manager, using gitlab.com/ImageMagick is slightly better, since it recognizes the domain correctly. Otherwise it sees git.imagemagics.org as a separate site.

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

Re: Non-standard behavior of identify *.png

Post by dlemstra »

git.imagemagick.org is our primary repository. We have a mirror on gitlab and github and we watch issues/pull requests on both of them.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Non-standard behavior of identify *.png

Post by glennrp »

Would it be sufficient to have "identify" put a space between the filename and the [scene number] ?
I think we could do that but unfortunately it might break some existing scripts, so it would require some thought.
wkoszek
Posts: 9
Joined: 2015-11-16T19:30:51-07:00
Authentication code: 1151

Re: Non-standard behavior of identify *.png

Post by wkoszek »

I think space would help.

BTW: If I want numbers in the output lines, I'll pipe the whole thing to `cat -n`, so not sure if this feature is necessary.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Non-standard behavior of identify *.png

Post by fmw42 »

The numbering is also used to identify multipage/multilayer images, page-by-page. I do not think that modifying this behavior is a good idea as it may break existing scripts. As dlemstra mentioned, you can customize your own identify. I think that is the best way to proceed.
Post Reply