tags:

views:

63

answers:

1

I've got some custom metadata to put into a PNG file. It's being saved through libpng, and it's not difficult to write out a custom chunk. I just call png_write_chunk with the name, length and data. But I can't see how to get the data back out again. I'd expect there to be a png_read_chunk function that takes a chunk name and returns a pointer to the data or something like that, but there's nothing like that in png.h.

Does anyone know how to accomplish this?

+2  A: 

Look for png_set_read_user_chunk_fn in the manual. There are standard functions for accessing the standard chunks once they have been read, and custom chunks are handled by invoking a custom callback.

jleedev