diff --git a/Tests/test_file_psd.py b/Tests/test_file_psd.py index 3b8a7add6..3d434d5a7 100644 --- a/Tests/test_file_psd.py +++ b/Tests/test_file_psd.py @@ -65,6 +65,12 @@ class TestImagePsd(PillowTestCase): self.assertRaises(EOFError, im.seek, -1) + def test_open_after_exclusive_load(self): + im = Image.open(test_file) + im.load() + im.seek(im.tell()+1) + im.load() + def test_icc_profile(self): im = Image.open(test_file) self.assertIn("icc_profile", im.info) diff --git a/src/PIL/PsdImagePlugin.py b/src/PIL/PsdImagePlugin.py index a8d370eed..17e6bc4e9 100644 --- a/src/PIL/PsdImagePlugin.py +++ b/src/PIL/PsdImagePlugin.py @@ -54,6 +54,7 @@ class PsdImageFile(ImageFile.ImageFile): format = "PSD" format_description = "Adobe Photoshop" + _close_exclusive_fp_after_loading = False def _open(self):