Page 1 of 1

can png file store information using IM

Posted: 2011-10-30T19:52:52-07:00
by linjuming
For example, I want to keep some information such as
"author : linjuming"
in the hello.png
Then next time I can use "identify -verbose hello.png" or some other command to find these informations.
Can IM do this job?

Code: Select all

D:\phpnow\htdocs\laji>identify -verbose kk.png
Image: kk.png
  Format: PNG (Portable Network Graphics)
  Class: PseudoClass
  Geometry: 20x128+0+0
......
Author : linjuming

Re: can png file store information using IM

Posted: 2011-10-30T21:37:18-07:00
by fmw42
see http://www.imagemagick.org/script/comma ... .php#label

convert logo: -set label "testing" logo.png
identify -verbose logo.png
...
Properties:
date:create: 2011-10-30T21:35:45-07:00
date:modify: 2011-10-30T21:35:45-07:00
label: testing
...

Re: can png file store information using IM

Posted: 2011-10-30T21:53:12-07:00
by linjuming
very great ! thank you.
and can identify output shorter infos?
the command identify -verbose output too logo informations while i only need the str "author : linjuming".
how many options for identify command ?

Re: can png file store information using IM

Posted: 2011-10-30T22:04:50-07:00
by anthony
The PNG image file format can actually store a lot of different information.
See Montage, using saved meta-data whcih looks at "label" "comment" "caption" and even random user data "my_data"

How much of this is accessible in other image processors is another matter. Perhaps Glenn can tell us!

Re: can png file store information using IM

Posted: 2011-10-31T10:47:35-07:00
by fmw42
Anthony is correct. I had not realized the issue about file format. So replace the above with


convert logo: -set comment "author:testing" logo.jpg

identify logo.jpg
...

Properties:
comment: author:testing
date:create: 2011-10-31T10:45:27-07:00
date:modify: 2011-10-31T10:45:27-07:00
jpeg:colorspace: 2
jpeg:sampling-factor: 2x2,1x1,1x1
signature: 7fc87782fc1f26c79908eabc94b0382b06d3c087101fd446b333c4137af340c4
...

Re: can png file store information using IM

Posted: 2011-10-31T14:21:48-07:00
by glennrp
Most of the ancillary information that's stored in a PNG can
be accessed with
  • identify -verbose -debug coder -log %e file.png
Use Linux "grep" or something equivalent to pick out the data you want.

Re: can png file store information using IM

Posted: 2011-11-01T09:42:06-07:00
by linjuming
great help ,thank you very much