From 5bdf1e49985408ef9898260733f5dd8ddf2673c0 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Thu, 17 Nov 2016 13:43:11 +0100 Subject: [PATCH] Test for libtiff, n_frames and seek. --- Tests/test_file_libtiff.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Tests/test_file_libtiff.py b/Tests/test_file_libtiff.py index 7839c4053..2bd289fa9 100644 --- a/Tests/test_file_libtiff.py +++ b/Tests/test_file_libtiff.py @@ -401,6 +401,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')