1. Fredrik Lundh
  2. pil-2009-raclette
  3. Issues
Issue #30 new

ImageFile.Parser.feed() breaks with some jpeg images: "ValueError: tile cannot extend outside image"

created an issue

I get this error: "ValueError: tile cannot extend outside image" when trying to feed the Parser small chunks of the attached image.

The code that does this comes from Django: https://github.com/django/django/blob/master/django/core/files/images.py#L58 in order to get the image height and width without loading all the image in memory.

I've tracked this error down to https://bitbucket.org/effbot/pil-117/src/f356a1f64271e9d3206fcf9059492ba1c9e163d6/PIL/ImageFile.py?at=default#cl-420 and later in https://bitbucket.org/effbot/pil-117/src/f356a1f64271e9d3206fcf9059492ba1c9e163d6/decode.c?at=default#cl-159

I don't know why this breaks with this image and not with other images, I haven't found anything wrong with this one.

Comments (0)

  1. Log in to comment