From: Andreas K. <And...@gm...> - 2012-06-19 18:12:55
|
Seems I didn't get the mail you've been replying to (yet). I'm reading the image in several passes, if interlaced, otherwise not. So, as a conclusion, would the recommendation be to call png_get_text() after the last png_read_rows() and before png_destroy_read_struct()? And to add an explicite png_read_end() before the png_get_text()? -------- Original Message -------- Subject: Re: [png-mng-implement] issue with libpng 1.5.10, ExifTool and text chunks From: <jb...@ac...> To: 'PNG/MNG implementation discussion list' <png...@li...> Date: 19.06.2012 19:47 > Glenn: >> Is your code looking for them in read_ptr or in end_ptr, if you have separate png_struct pointers for before and after IDAT? > > That would be png_info pointers, but IRC this doesn't matter with the sequential reader. What *does* matter is the pointer passed to: > > png_read_end(png_ptr, info_ptr); > > The information chunks after IDAT are read in the png_read_end call, and the results are added to *info_ptr. Libpng shouldn't care which structure 'info_ptr' points too, all that matters is that the text chunks are read *after* the call to png_read_end and the contents of *all* the info_ptrs used (the one in png_read_info and the one in png_read_end, if different) are combined together. > > The situation with the progressive reader is somewhat different, there is only one info_ptr and it gets passed to both the info_fn and the end_fn. In practice the text chunks need to be read in the end_fn, otherwise the ones at the end will never be seen. > > This is actually pretty tricky and I suspect most applications that do handle text chunks end up ignoring the ones after the image. Any app that loads the PNG, checks the info, then, later, displays it is likely to do this because there is currently no function to simply read the whole PNG skipping the IDATs in order to find all the data (and implementing one would require major work in libpng.) > > John Bowler <jb...@ac...> |