# create label
convert rose: -set label "testing" rose.png
# extract label
This works:
identify -format "%[label]\n" rose.png
testing
This works:
convert rose.png -format "%l\n" info:
testing
These return nothing (lower case L not I):
identify -format "%l" rose.png
identify -format "%l\n" rose.png
possible bug "%l" (label) IM 6.8.6.9 Q16 Mac OSX
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: possible bug "%l" (label) IM 6.8.6.9 Q16 Mac OSX
Behaviour confirmed on Windows, IM v6.8.6-9 and many older versions.
snibgo's IM pages: im.snibgo.com
Re: possible bug "%l" (label) IM 6.8.6.9 Q16 Mac OSX
Try
- identify +ping -format "%l" rose.png
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: possible bug "%l" (label) IM 6.8.6.9 Q16 Mac OSX
Yup, "+ping" does the trick (in Windows).
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug "%l" (label) IM 6.8.6.9 Q16 Mac OSX
magick wrote:Try
- identify +ping -format "%l" rose.png
Works for me also on IM 6.8.6.9 Q16 Mac OSX.
But does this mean that +ping is the solution for this or you just need it to verify what is going on?
Its use does not seem consistent. Since
identify -format "%w\n" rose.png
works fine without +ping
Re: possible bug "%l" (label) IM 6.8.6.9 Q16 Mac OSX
By default we "ping" an image. That is, read certain meta information about the image and bail before we read the image pixels. This makes reading images very fast and consumes few resources. Unfortunately the label information is not available when pinging PNG images, thus the +ping requirement. This is specific to PNG which locates the label after the image pixels (DAT section).
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug "%l" (label) IM 6.8.6.9 Q16 Mac OSX
Thanks for the explanation.
But why does
convert rose.png -format "%l" info:
work. Does it not do ping by default? Is that how it is different from identify?
But why does
convert rose.png -format "%l" info:
work. Does it not do ping by default? Is that how it is different from identify?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: possible bug "%l" (label) IM 6.8.6.9 Q16 Mac OSX
convert does not 'ping' images it always reads in the image in total into memory.
As such labels and other meta data (beyond basic image width,height, depth, colorspace) is available.
NOTE that using any more complex format escape, (eg %[...]) or verbose will automatically disable this default minimal 'ping' image read!
I have updated the identify section in IM Examples basics..
Identify, to Ping or not to Ping
http://www.imagemagick.org/Usage/basics/#identify_ping
Should appear in a hour or two.
Question is does using '-ping' ensure that images are not read in total.
For example this turns off the minimal 'ping' read I specifically requested to be performed!
In this case I actually do set the label, meaning the image was full read in, even though I requested it not to have been!
Why is this important? because we may only being doing some simple mathematics that does not need all the information.
In this case a 'ping' is actually really wanted as I don't need image data!
But identify still reads in the whole image!
This I consider a real BUG.
As such labels and other meta data (beyond basic image width,height, depth, colorspace) is available.
NOTE that using any more complex format escape, (eg %[...]) or verbose will automatically disable this default minimal 'ping' image read!
I have updated the identify section in IM Examples basics..
Identify, to Ping or not to Ping
http://www.imagemagick.org/Usage/basics/#identify_ping
Should appear in a hour or two.
Question is does using '-ping' ensure that images are not read in total.
For example this turns off the minimal 'ping' read I specifically requested to be performed!
Code: Select all
identify -ping -format '"%[l]"\n' rose.png
Why is this important? because we may only being doing some simple mathematics that does not need all the information.
Code: Select all
identify -ping -format '"%[fx:w*2]x%[fx:h*2]"\n' rose.png
But identify still reads in the whole image!
This I consider a real BUG.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/