How to add extra meta data to PNG?
Asked Answered
A

1

7

is there a way to add some extra metadata to a PNG file and then retrieve it with PHP ?

like Comment field.

Armilda answered 21/12, 2010 at 7:50 Comment(6)
Are you talking about image metadata, such as a comment field? stat doesn't have anything to do with that, or PNG files: stat gets information on the file, such as size, times, etc.Fuhrman
@Thanatos: yes like comment field and how to add extra fields, I know stat only output the file size and some other information i was thinking if some how to add some extra data to it.Armilda
The answers to this question might be helpful to you. #2190736Bashful
some program like exiftool ?Virulence
Here is a handy php exif manipulation library.Dinghy
Possible duplicate of How can I add metadata to an image?Mormon
B
8

If you have ImageMagick installed, it comes with two utilities: mogrify and identify.

To add comments:

$ mogrify.exe -comment "My test comment" plogo.png

To retrieve comments:

$ identify.exe -verbose plogo.png  | grep -i "comment:"
    comment: My test comment

I don't know if mogrify/identify functions are available as PHP libraries, but you can always use the php system command.

Bashful answered 21/12, 2010 at 8:12 Comment(1)
thanks for you answer but i think Imagmagic is a bit expansive for the what I wanna do.Armilda

© 2022 - 2024 — McMap. All rights reserved.