From 26fb0eadadd36f37363d38a88a55d2b614f769ed Mon Sep 17 00:00:00 2001 From: Eric Buehl Date: Tue, 20 Aug 2013 16:53:55 +0000 Subject: [PATCH] issue warning instead of debug/print --- PIL/TiffImagePlugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PIL/TiffImagePlugin.py b/PIL/TiffImagePlugin.py index acd41433b..31d371ed7 100644 --- a/PIL/TiffImagePlugin.py +++ b/PIL/TiffImagePlugin.py @@ -47,6 +47,7 @@ from PIL import Image, ImageFile from PIL import ImagePalette from PIL import _binary +import warnings import array, sys import collections import itertools @@ -398,8 +399,7 @@ class ImageFileDirectory(collections.MutableMapping): data = ifd[8:8+size] if len(data) != size: - if Image.DEBUG: - print("- expecting to read %d bytes but only got %d. skipping tag %s" % (size, len(data), tag)) + 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