mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-25 16:20:33 +03:00
Merge pull request #4563 from radarhere/faster_error
Throw image loading error faster
This commit is contained in:
commit
e4fa234340
|
@ -150,10 +150,10 @@ class ImageFile(Image.Image):
|
||||||
def load(self):
|
def load(self):
|
||||||
"""Load image data based on tile list"""
|
"""Load image data based on tile list"""
|
||||||
|
|
||||||
pixel = Image.Image.load(self)
|
|
||||||
|
|
||||||
if self.tile is None:
|
if self.tile is None:
|
||||||
raise OSError("cannot load this image")
|
raise OSError("cannot load this image")
|
||||||
|
|
||||||
|
pixel = Image.Image.load(self)
|
||||||
if not self.tile:
|
if not self.tile:
|
||||||
return pixel
|
return pixel
|
||||||
|
|
||||||
|
|
|
@ -1094,10 +1094,10 @@ class TiffImageFile(ImageFile.ImageFile):
|
||||||
""" Overload method triggered when we detect a compressed tiff
|
""" Overload method triggered when we detect a compressed tiff
|
||||||
Calls out to libtiff """
|
Calls out to libtiff """
|
||||||
|
|
||||||
pixel = Image.Image.load(self)
|
|
||||||
|
|
||||||
if self.tile is None:
|
if self.tile is None:
|
||||||
raise OSError("cannot load this image")
|
raise OSError("cannot load this image")
|
||||||
|
|
||||||
|
pixel = Image.Image.load(self)
|
||||||
if not self.tile:
|
if not self.tile:
|
||||||
return pixel
|
return pixel
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user