mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-01 08:27:30 +03:00 
			
		
		
		
	Testing the imagesequence module with the multipage tiffs
This commit is contained in:
		
							parent
							
								
									d5b4f136c5
								
							
						
					
					
						commit
						3df822d1ef
					
				|  | @ -1,6 +1,6 @@ | ||||||
| from helper import unittest, PillowTestCase, lena | from helper import unittest, PillowTestCase, lena | ||||||
| 
 | 
 | ||||||
| from PIL import ImageSequence | from PIL import Image, ImageSequence, TiffImagePlugin | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class TestImageSequence(PillowTestCase): | class TestImageSequence(PillowTestCase): | ||||||
|  | @ -22,6 +22,25 @@ class TestImageSequence(PillowTestCase): | ||||||
| 
 | 
 | ||||||
|         self.assertEqual(index, 1) |         self.assertEqual(index, 1) | ||||||
| 
 | 
 | ||||||
|  |     def _test_multipage_tiff(self): | ||||||
|  |         im = Image.open('Tests/images/multipage.tiff') | ||||||
|  |         for index, frame in enumerate(ImageSequence.Iterator(im)): | ||||||
|  |             frame.load() | ||||||
|  |             self.assertEqual(index, im.tell()) | ||||||
|  |             frame.convert('RGB') | ||||||
|  |              | ||||||
|  |     def test_tiff(self): | ||||||
|  |         return self._test_multipage_tiff() | ||||||
|  | 
 | ||||||
|  |     def test_libtiff(self): | ||||||
|  |         codecs = dir(Image.core) | ||||||
|  |          | ||||||
|  |         if "libtiff_encoder" not in codecs or "libtiff_decoder" not in codecs: | ||||||
|  |             self.skipTest("tiff support not available") | ||||||
|  | 
 | ||||||
|  |         TiffImagePlugin.READ_LIBTIFF = True | ||||||
|  |         self._test_multipage_tiff() | ||||||
|  |         TiffImagePlugin.READ_LIBTIFF = False | ||||||
|          |          | ||||||
| if __name__ == '__main__': | if __name__ == '__main__': | ||||||
|     unittest.main() |     unittest.main() | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user