raise IOError in all cases when image can't be loaded

This commit is contained in:
homm 2015-07-31 15:48:51 +03:00
parent b8b3cdc146
commit b078ad4599

View File

@ -209,7 +209,7 @@ class ImageFile(Image.Image):
if LOAD_TRUNCATED_IMAGES:
break
else:
raise IndexError(ie)
raise IOError("image file is truncated")
if not s and not d.handles_eof: # truncated jpeg
self.tile = []