[Image-SIG] IOError: unable to identify image file(possibly weird EXIF data?)

Luke Hutscal luke at liftinteractive.com
Wed Feb 11 21:52:33 CET 2009

Hello, all.

I am currently working on a Django application that uses sorl-thumbnail(
http://code.google.com/p/sorl-thumbnail/) to do some image thumbnailing for
us, which is using PIL to interact with the images that it thumbnails.

Unfortunately, we seem to have encountered an intermittent problem:
occasionally, PIL will raise an IOError: unable to identify image file with
the files that we are trying to have it process.

I did some digging into PIL, and determined that the error being raised is
coming from JpegImagePlugin.py, at line 283(where a SyntaxError is raised if
there was no marker found). I added some debugging statements around the
error to see what the value of i was, and the first value that this
exception occurs on is "8224".

I am fairly certain that this issue is occuring because of something to do
with the EXIF data embedded in the jpeg's that we are trying to work with; I
have uploaded the jpegs and the EXIF data I could extract with ExifTool(
http://www.sno.phy.queensu.ca/~phil/exiftool/) here:


Does anyone know what might be going wrong here, or why PIL might be having
trouble with these images?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/image-sig/attachments/20090211/1f3aad13/attachment.htm>

More information about the Image-SIG mailing list