be more tolerant of tag read failures

this can occur if the MakerNote has a pointer to outside the EXIF block
This commit is contained in:
Eric Buehl 2013-08-19 22:51:50 +00:00
parent ca8e84dfce
commit 7430dc261f

View File

@ -398,7 +398,9 @@ class ImageFileDirectory(collections.MutableMapping):
data = ifd[8:8+size]
if len(data) != size:
raise IOError("not enough data")
if Image.DEBUG:
print("- expecting to read %d bytes but only got %d. skipping tag %s" % (size, len(data), tag))
continue
self.tagdata[tag] = typ, data
self.tagtype[tag] = typ