diff --git a/PIL/ImageFile.py b/PIL/ImageFile.py index 688c33a1d..3b60c0d05 100644 --- a/PIL/ImageFile.py +++ b/PIL/ImageFile.py @@ -226,9 +226,8 @@ class ImageFile(Image.Image): self.fp = None # might be shared - if not LOAD_TRUNCATED_IMAGES and not self.map and e < 0: - # Note: If loading a truncated image results in an all black Image, - # the decoder wasn't able to decode anything. + if (t == 0 or not LOAD_TRUNCATED_IMAGES) and not self.map and e < 0: + # still raised if decoder fails to return anything raise_ioerror(e) # post processing