Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#26 support building with zlib<1.2.4 (inflateReset2 in pngfix)

Marcin Wojdyr

Currently (1.6.10), although the library itself can be built with old zlib, pngfix fails to link with it because it uses inflateReset2.

It would be nice if either building pngfix could be disabled using a configure flag, or if inflateReset2 was used conditionally, like in pngrutil.c.


  • As far as I can tell, PNG_ZLIB_VERNUM is always 0 (set in scripts/pnglibconf.dfa), and we should be testing ZLIB_VERNUM in pngfix.c instead.

    • PNG_ZLIB_VERNUM is normally the same as ZLIB_VERNUM when the "configure" system is used. Its purpose is to detect whether libpng is running with the same zlib that was used to build it; see code beginning at line 12 in pngpriv.h. When it is "0" we avoid this test. I think pngfix should always be testing ZLIB_VERNUM instead of PNG_ZLIB_VERNUM.

  • Please try libpng-1.6.11rc02 which tests for ZLIB_VERNUM instead of PNG_ZLIB_VERNUM in contrib/tools/pngfix.c

    • assigned_to: Glenn Randers-Pehrson
    • Group: -->
    • Marcin Wojdyr
      Marcin Wojdyr

      Thanks for quick response. It builds now and prints:

      ws024:libpng-1.6.11rc02 wojdyr$ ./pngfix
      pngfix needs libpng with a zlib >=1.2.4 (not 0x1230)

    • status: open --> closed-accepted
  • Fixed in libpng-1.6.11, thanks.