2

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?

0

1 Answer 1

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.