Recent

Author Topic: Add metadata information to a png file  (Read 3036 times)

dcelso

  • Full Member
  • ***
  • Posts: 158
Add metadata information to a png file
« on: November 03, 2016, 03:20:03 pm »
Helllo to all,
How can I add extra information to a png file?

I have tried use TPortableNetworkGraphic but I can not find any property to add custom information.

Thanks.

wp

  • Hero Member
  • *****
  • Posts: 7745
Re: Add metadata information to a png file
« Reply #1 on: November 03, 2016, 03:26:52 pm »
The png file format does not support metadata (https://stackoverflow.com/questions/8113314/does-png-support-metadata-fields-like-author-camera-model-etc). You must use jpg or tiff for this.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

dcelso

  • Full Member
  • ***
  • Posts: 158
Re: Add metadata information to a png file
« Reply #2 on: November 03, 2016, 03:33:49 pm »
Are you sure?

https://en.wikipedia.org/wiki/Portable_Network_Graphics  <---  "Ancillary chunks" section

Have a nice day, bro.

Thaddy

  • Hero Member
  • *****
  • Posts: 10586
Re: Add metadata information to a png file
« Reply #3 on: November 03, 2016, 03:36:20 pm »
http://dev.exiv2.org/projects/exiv2/wiki/The_Metadata_in_PNG_files
https://en.wikipedia.org/wiki/Portable_Network_Graphics#Ancillary_chunks
https://www.w3.org/TR/PNG/#11textinfo

So png does support metadata. It just is not supported by the LCL component atm.
I suggest you ask the maintainer to support it. Can be on the bug tracker.

@wp SO is not always a good source of information. Look for the specifications.....
« Last Edit: November 03, 2016, 03:44:56 pm by Thaddy »

apeoperaio

  • Full Member
  • ***
  • Posts: 189
Re: Add metadata information to a png file
« Reply #4 on: November 12, 2020, 12:14:41 pm »
I would like to know if metadata is now supported using TPortableNetworkGraphic.

wp

  • Hero Member
  • *****
  • Posts: 7745
Re: Add metadata information to a png file
« Reply #5 on: November 12, 2020, 12:25:53 pm »
Certainly no.

I wrote an exif library (fpexif, https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/fpexif/), but it inspects only the jpeg and tiff file formats, and I don't have time atm to extend it to png.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

apeoperaio

  • Full Member
  • ***
  • Posts: 189
Re: Add metadata information to a png file
« Reply #6 on: November 12, 2020, 02:10:35 pm »
Thank you, I will look at it

 

TinyPortal © 2005-2018