diff --git a/src/PIL/ImageFile.py b/src/PIL/ImageFile.py index 8637a47f9..9a780b4e0 100644 --- a/src/PIL/ImageFile.py +++ b/src/PIL/ImageFile.py @@ -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 diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py index 4b04752ed..e8d82ae46 100644 --- a/src/PIL/TiffImagePlugin.py +++ b/src/PIL/TiffImagePlugin.py @@ -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