From 7430dc261fc74d7bc7eaca4996f1df9643c0d673 Mon Sep 17 00:00:00 2001 From: Eric Buehl Date: Mon, 19 Aug 2013 22:51:50 +0000 Subject: [PATCH] be more tolerant of tag read failures this can occur if the MakerNote has a pointer to outside the EXIF block --- PIL/TiffImagePlugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PIL/TiffImagePlugin.py b/PIL/TiffImagePlugin.py index de0c4c530..acd41433b 100644 --- a/PIL/TiffImagePlugin.py +++ b/PIL/TiffImagePlugin.py @@ -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