开发者

How do I read an arbitrary chunk from a PNG file?

开发者 https://www.devze.com 2022-12-25 18:18 出处:网络
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.B

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开发者_Python百科 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消