Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

be more tolerant of tag read failures #320

Merged
merged 2 commits into from
Aug 21, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion PIL/TiffImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
from PIL import ImagePalette
from PIL import _binary

import warnings
import array, sys
import collections
import itertools
Expand Down Expand Up @@ -398,7 +399,8 @@ def load(self, fp):
data = ifd[8:8+size]

if len(data) != size:
raise IOError("not enough data")
warnings.warn("Possibly corrupt EXIF data. 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
Expand Down