More info:

>>> im = Image.open('my_logo.png')
>>> outfile = 'my_logo.jpg'
>>> im.save(outfile)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/site-packages/PIL/Image.py", line 1272, in save
    self.load()
  File "/usr/lib/python2.4/site-packages/PIL/ImageFile.py", line 155, in
load
    self.load_prepare()
  File "/usr/lib/python2.4/site-packages/PIL/PngImagePlugin.py", line 337,
in load_prepare
    raise IOError("cannot read interlaced PNG files")
IOError: cannot read interlaced PNG files

Is there some way I can work with interlaced PNG's in PIL?

On Sat, Mar 21, 2009 at 5:29 PM, Nate Reed <natereed....@gmail.com> wrote:

> I have a model that uses sorl-thumbnail.ImageWithThumbnailsField:
>
> class Vendor(models.Model):
>     url = models.URLField()
>     logo = ImageWithThumbnailsField(
>         blank = True,
>         null = True,
>         upload_to = 'logos',
>         thumbnail={'size': (80, 80)}
>     )
>
> When I try to create a new Vendor using a particular PNG file (it would
> works for some PNG's but not this one) in my admin interface, I get the
> following error for the 'logo' field:
>
> "Upload a valid image. The file you uploaded was either not an image or a
> corrupted image."
>
> I've verified this image is not corrupted, and it's a valid PNG file.
> Also, the error doesn't seem to be coming from PIL:
>
> >>> import Image
> >>> im = Image.open('my_logo.png')
> >>> print im.format, im.size, im.mode
> PNG (142, 49) P
>
> Here's the format/size/mode for one that works fine with image uploading:
> PNG (420, 420) RGBA
>
> Any ideas?  How can I find where this error is originating?
>
> Nate
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to