2

According to this Wikipedia entry on the PNG format, a PNG image file can have embedded text stored in its tEXt chunks. This allows storing some text along with the image, which isn't visible in the image itself, but is hidden within the file.

Question is: how can I read these name=value pairs from a PNG file using the Java2D api? Does the ImageReader class help me here? Can anyone produce a short snippet?

Thank you!

axel22
  • 32,045
  • 9
  • 125
  • 137
  • 1
    Look at the answer for this question: http://stackoverflow.com/questions/10454733/obtain-text-fields-from-a-png-file/10485746#10485746 – dragon66 May 08 '12 at 19:47

2 Answers2

4

This should be possible with javapng.

Use com.sixlegs.png.PngImage#getTextChunk(String).

Sandro
  • 1,266
  • 2
  • 13
  • 25
2

PNGJ library lets you read/write the three types of textual chunks.

leonbloy
  • 73,180
  • 20
  • 142
  • 190