mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Use _min_frame in ImageSequence.Iterator
This commit is contained in:
parent
72d5ee3bfa
commit
ea02e28adb
|
@ -32,6 +32,12 @@ class TestImageSequence(PillowTestCase):
|
|||
self.assertRaises(IndexError, lambda: i[index+1])
|
||||
self.assertRaises(StopIteration, next, i)
|
||||
|
||||
def test_iterator_min_frame(self):
|
||||
im = Image.open('Tests/images/hopper.psd')
|
||||
i = ImageSequence.Iterator(im)
|
||||
for index in range(1, im.n_frames):
|
||||
self.assertEqual(i[index], next(i))
|
||||
|
||||
def _test_multipage_tiff(self):
|
||||
im = Image.open('Tests/images/multipage.tiff')
|
||||
for index, frame in enumerate(ImageSequence.Iterator(im)):
|
||||
|
|
|
@ -32,7 +32,7 @@ class Iterator(object):
|
|||
if not hasattr(im, "seek"):
|
||||
raise AttributeError("im must have seek method")
|
||||
self.im = im
|
||||
self.position = 0
|
||||
self.position = getattr(self.im, "_min_frame", 0)
|
||||
|
||||
def __getitem__(self, ix):
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue
Block a user