mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Merge pull request #4565 from radarhere/tiff_pickle
Fixed bug when unpickling TIFF images
This commit is contained in:
commit
ddebe27eed
|
@ -45,6 +45,7 @@ def helper_pickle_string(pickle, protocol, test_file, mode):
|
|||
pytest.param(
|
||||
"Tests/images/hopper.webp", None, marks=skip_unless_feature("webp")
|
||||
),
|
||||
("Tests/images/hopper.tif", None),
|
||||
("Tests/images/test-card.png", None),
|
||||
("Tests/images/zero_bb.png", None),
|
||||
("Tests/images/zero_bb_scale2.png", None),
|
||||
|
|
|
@ -1066,7 +1066,7 @@ class TiffImageFile(ImageFile.ImageFile):
|
|||
return self.__frame
|
||||
|
||||
def load(self):
|
||||
if self.use_load_libtiff:
|
||||
if self.tile and self.use_load_libtiff:
|
||||
return self._load_libtiff()
|
||||
return super().load()
|
||||
|
||||
|
@ -1094,12 +1094,7 @@ class TiffImageFile(ImageFile.ImageFile):
|
|||
""" Overload method triggered when we detect a compressed tiff
|
||||
Calls out to libtiff """
|
||||
|
||||
if self.tile is None:
|
||||
raise OSError("cannot load this image")
|
||||
|
||||
pixel = Image.Image.load(self)
|
||||
if not self.tile:
|
||||
return pixel
|
||||
Image.Image.load(self)
|
||||
|
||||
self.load_prepare()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user