[Image-SIG] PNG Decoder Bug

Bernhard Herzog bh@intevation.de
16 Jan 2001 13:54:10 +0100


"Fredrik Lundh" <fredrik@pythonware.com> writes:

> bernhard wrote:
> 
> > PIL has problems decoding some PNG files. An image which PIL fails to
> > load can be found at http://intevation.de/~bh/6x2.png .
> 
> /.../
> 
> > IOError: decoder error -3 when reading image file
> > 
> > I reported this bug before (or at least a very similar one) back in 1999
> > ( http://mail.python.org/pipermail/image-sig/1999-October/000892.html )
> > but I ran into it again now. Perhaps someone should set up a bug tracker
> > so such bugs aren't forgotten. 
> 
> well, it's a known and documented bug.
> 
> from the "Image File Formats" chapter:
>     The library identifies, reads, and writes PNG files containing
> 
>     "1", "L", "P", "RGB", or "RGBA" data. Interlaced files are currently
> 
>     not supported.

Ok, I should have been more specific. The file in question was generated
by PIL and is not interlaced. PIL can read most of the other files
generated with the same parameters flawlessly.

I know about the limitation to non-interlaced PNGs. That's why I linked
to the last post in the thread. Its last paragraph is probably the same
problem I have now.

As Andrew Kuchling had pointed out back then, it might be a zlib bug. I
tried to read the file with other programs (netscape, gimp, pngtopnm,
gqview) and none have problems with it, but as far as I know all of them
use libpng, so that doesn't really prove anything.

   Bernhard

-- 
Intevation GmbH                                 http://intevation.de/
Sketch                                 http://sketch.sourceforge.net/
MapIt!                                               http://mapit.de/