diff --git a/PIL/JpegImagePlugin.py b/PIL/JpegImagePlugin.py index b1c25db1d..38e4a5f87 100644 --- a/PIL/JpegImagePlugin.py +++ b/PIL/JpegImagePlugin.py @@ -422,6 +422,9 @@ def _getexif(self): exif[key] = _fixup(value) # get exif extension try: + # exif field 0x8769 is an offset pointer to the location + # of the nested embedded exif ifd. + # It should be a long, but may be corrupted. file.seek(exif[0x8769]) except (KeyError, TypeError): pass @@ -432,7 +435,10 @@ def _getexif(self): exif[key] = _fixup(value) # get gpsinfo extension try: - file.seek(exif[0x8825]) + # exif field 0x8825 is an offset pointer to the location + # of the nested embedded gps exif ifd. + # It should be a long, but may be corrupted. + file.seek(exif[0x8825]) except (KeyError, TypeError): pass else: