PIL Error: "cannot read interlaced PNG files"

T

T-u-N-i-X

Hey There,

I'm developing an application that lets the user to upload JPG and PNG
files. I'm using PIL to check the images after the upload (like
checking it storage size, width and height). But PIL raises an error:

"cannot read interlaced PNG files"

It says that interlaced PNG files are not supported in the PIL
documentation. I'm using PIL 1.1.6-2 on Arch Linux..

I can check all images with:

from PIL import Image
im = Image.open('image.png')
im.info

which returns a dictionary about the image. If the dict has
'interlace' key with the value 1, then I reject the event that's being
send with a validation error. But I don't think this is a good idea
since this could be very annoying for the users.
 
S

Steve Holden

T-u-N-i-X said:
Hey There,

I'm developing an application that lets the user to upload JPG and PNG
files. I'm using PIL to check the images after the upload (like
checking it storage size, width and height). But PIL raises an error:

"cannot read interlaced PNG files"

It says that interlaced PNG files are not supported in the PIL
documentation. I'm using PIL 1.1.6-2 on Arch Linux..

I can check all images with:

from PIL import Image
im = Image.open('image.png')
im.info

which returns a dictionary about the image. If the dict has
'interlace' key with the value 1, then I reject the event that's being
send with a validation error. But I don't think this is a good idea
since this could be very annoying for the users.
Perhaps so, but it would seem this is your only viable option short of
either persuading the effbot to patch PIL to read interlaced PNGs or
patching it yourself.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top