mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
issue warning instead of debug/print
This commit is contained in:
parent
7430dc261f
commit
26fb0eadad
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user