Page 1 of 1

Non-standard behavior of identify *.png

Posted: 2015-11-16T19:42:20-07:00
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

Re: Non-standard behavior of identify *.png

Posted: 2015-11-17T02:04:04-07:00
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

Re: Non-standard behavior of identify *.png

Posted: 2015-11-19T14:10:43-07:00
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.

Re: Non-standard behavior of identify *.png

Posted: 2015-11-19T14:29:42-07:00
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.

Re: Non-standard behavior of identify *.png

Posted: 2015-11-19T14:40:59-07:00
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.

Re: Non-standard behavior of identify *.png

Posted: 2016-04-18T09:07:16-07:00
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.

Re: Non-standard behavior of identify *.png

Posted: 2016-04-18T11:11:11-07:00
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.