mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 17:24:31 +03:00
Throw image loading error faster
This commit is contained in:
parent
49e49d3cfc
commit
fe8225732a
|
@ -150,10 +150,10 @@ class ImageFile(Image.Image):
|
|||
def load(self):
|
||||
"""Load image data based on tile list"""
|
||||
|
||||
pixel = Image.Image.load(self)
|
||||
|
||||
if self.tile is None:
|
||||
raise OSError("cannot load this image")
|
||||
|
||||
pixel = Image.Image.load(self)
|
||||
if not self.tile:
|
||||
return pixel
|
||||
|
||||
|
|
|
@ -1094,10 +1094,10 @@ class TiffImageFile(ImageFile.ImageFile):
|
|||
""" Overload method triggered when we detect a compressed tiff
|
||||
Calls out to libtiff """
|
||||
|
||||
pixel = Image.Image.load(self)
|
||||
|
||||
if self.tile is None:
|
||||
raise OSError("cannot load this image")
|
||||
|
||||
pixel = Image.Image.load(self)
|
||||
if not self.tile:
|
||||
return pixel
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user