I would like to write metadata to a PNG image that I create.
My understanding of Java Advanced Image API is that I should use IIOMetadata, but code snippets I found seem overly complicated. Then I searched for a library and found Sanselan but it seems a bit old, and not very handy for writing metadata.
To actually create the image, I use
ImageIO.write(image, "png", baos);
I understand image metadatas are complex to handle due to its XML-like structure. Could anybody point me to a tutorial, solution, or library that will help?
I had to do the the same thing some days ago.. I have not found the exact solution on the internet either but looking at the
com.sun.imageio.plugins.png.PNGMetadataclass I could achieve some results..To write a custom metadata to a PNG file:
Then, to read the data: