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


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.


  • Glenn Randers-Pehrson

    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.

    • Glenn Randers-Pehrson

      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.

  • Glenn Randers-Pehrson

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

  • Glenn Randers-Pehrson

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

      Marcin Wojdyr - 2014-06-04

      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)

  • Glenn Randers-Pehrson

    • status: open --> closed-accepted
  • Glenn Randers-Pehrson

    Fixed in libpng-1.6.11, thanks.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks