mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-10 00:02:24 +03:00
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:
parent
ca8e84dfce
commit
7430dc261f
|
@ -398,7 +398,9 @@ class ImageFileDirectory(collections.MutableMapping):
|
||||||
data = ifd[8:8+size]
|
data = ifd[8:8+size]
|
||||||
|
|
||||||
if len(data) != 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.tagdata[tag] = typ, data
|
||||||
self.tagtype[tag] = typ
|
self.tagtype[tag] = typ
|
||||||
|
|
Loading…
Reference in New Issue
Block a user