[Image-SIG] PNG writing bug

Fredrik Lundh fredrik@pythonware.com
Wed, 30 Jun 1999 12:58:07 +0200

A.M. Kuchling wrote:
> I'm beginning to suspect that this is a bug in zlib that trips when it
> fills up its output buffer in one particular situation, perhaps
> missing a byte somewhere.  The code in ZipEncode seems OK and hasn't
> changed since 0.3b2; recompiling 0.3b2 with my current zlib library
> also manifests the bug.  Changing Z_NO_FLUSH to Z_SYNC_FLUSH makes the
> bug go away, as does making the output buffer so large that it never
> fills up.  I'm trying to find older versions of zlib to figure out
> what changed, but haven't succeeded yet.

should I change Z_NO_FLUSH to Z_SYNC_FLUSH?

(if I understand things correctly, this will make the files a bit
larger, but as long as the output buffer size is kept relatively
large, that shouldn't matter much.  just a few extra bytes per
64k block, most likely)