Test for libtiff, n_frames and seek.

This commit is contained in:
Marcus Brinkmann 2016-11-17 13:43:11 +01:00
parent 17d38d0905
commit 19d30c170e

View File

@ -399,6 +399,19 @@ class TestFileLibTiff(LibTiffTestCase):
TiffImagePlugin.READ_LIBTIFF = False
def test_multipage_nframes(self):
# issue #862
TiffImagePlugin.READ_LIBTIFF = True
im = Image.open('Tests/images/multipage.tiff')
frames = im.n_frames
self.assertEqual(frames, 3)
for idx in range(frames):
im.seek(0)
# Should not raise ValueError: I/O operation on closed file
im.load()
TiffImagePlugin.READ_LIBTIFF = False
def test__next(self):
TiffImagePlugin.READ_LIBTIFF = True
im = Image.open('Tests/images/hopper.tif')
@ -521,7 +534,7 @@ class TestFileLibTiff(LibTiffTestCase):
except:
self.fail("Should not get permission error here")
if __name__ == '__main__':