This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: PIL freeze reading Jpeg file
Type: crash Stage: resolved
Components: Versions:
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: ezio.melotti, lolo27
Priority: normal Keywords:

Created on 2013-08-20 20:33 by lolo27, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit
20070517-152405_lovers_4 (copie).jpg lolo27, 2013-08-20 20:33
Messages (2)
msg195715 - (view) Author: lolo27 (lolo27) Date: 2013-08-20 20:33
With this Python program and 20070517-152405_lovers_4 (copie).jpg  (this file is ok whith Gimp and others programs).

Program "freeze" ( line print "Done" is not processing).

from PIL import Image
from PIL.ExifTags import TAGS
def get_exif(fn):
    ret = {}
    i =
    info = i._getexif()
    for tag, value in info.items():
        decoded = TAGS.get(tag, tag)
        ret[decoded] = value
    return ret
get_exif("./20070517-152405_lovers_4 (copie).jpg")
print "Done"

Console output  :

Traceback (most recent call last):
  File "", line 14, in <module>
    get_exif("./20070517-152405_lovers_4 (copie).jpg")
  File "", line 7, in get_exif
    info = i._getexif()
  File "/usr/lib/python2.7/dist-packages/PIL/", line 381, in _getexif
  File "/usr/lib/python2.7/dist-packages/PIL/", line 348, in load
    for i in range(i16(
  File "/usr/lib/python2.7/dist-packages/PIL/", line 68, in il16
    return ord(c[o]) + (ord(c[o+1])<<8)
IndexError: string index out of range


Linux Mint : Linux mystation 3.2.0-4-amd64 #1 SMP Debian 3.2.32-1 x86_64 GNU/Linux
Python :  2.7.3rc2 (no additional lib installed) : __version__ = "1.3.5"
msg195716 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-08-20 20:34
PIL is not part of the standard library, you should report this on the PIL bug tracker.
Date User Action Args
2022-04-11 14:57:49adminsetgithub: 62991
2013-08-20 20:34:58ezio.melottisetstatus: open -> closed

nosy: + ezio.melotti
messages: + msg195716

resolution: not a bug
stage: resolved
2013-08-20 20:33:44lolo27create