Re: Why is it that png files are not dependable over the long haul
Ruben Safir <ruben-v1XHP5QhJixWk0Htik3J/[email protected]> Mon, 6 Aug 2018 03:34:58 -0400
| Newsgroups | gmane.comp.graphics.png.devel |
|---|---|
| Message-ID | <[email protected]> |
On 08/05/2018 11:36 PM, Cosmin Truta wrote: > On Thu, 2 Aug 2018 at 02:37, J Decker wrote: >> Experimenting with the chromium modified zlib, I found a flag INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR > > That's in the original zlib, also. But you don't need it. > > What you need is the following libpng function call: > > png_set_option(png_ptr, > PNG_MAXIMUM_INFLATE_WINDOW, > PNG_OPTION_ON); > > See the libpng manual for details. > > To conclude the story from my previous email: > > If PNG_MAXIMUM_INFLATE_WINDOW is set to PNG_OPTION_OFF (i.e. the > default), libpng can diagnose the error, but not recover from it. > Conversely, if PNG_MAXIMUM_INFLATE_WINDOW is set to PNG_OPTION_ON, > libpng can decode the image, but not know that the image had an error. > It's an either/or proposition, unfortunately. > > Sincerely, > Cosmin > Am I going to be able to recover these image files? Ruben ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot