mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-10 16:22:22 +03:00
Improved load truncated images
This commit is contained in:
parent
ee04c7ceea
commit
33bf5d9d37
|
@ -226,9 +226,8 @@ class ImageFile(Image.Image):
|
||||||
|
|
||||||
self.fp = None # might be shared
|
self.fp = None # might be shared
|
||||||
|
|
||||||
if not LOAD_TRUNCATED_IMAGES and not self.map and e < 0:
|
if (t == 0 or not LOAD_TRUNCATED_IMAGES) and not self.map and e < 0:
|
||||||
# Note: If loading a truncated image results in an all black Image,
|
# still raised if decoder fails to return anything
|
||||||
# the decoder wasn't able to decode anything.
|
|
||||||
raise_ioerror(e)
|
raise_ioerror(e)
|
||||||
|
|
||||||
# post processing
|
# post processing
|
||||||
|
|
Loading…
Reference in New Issue
Block a user