Add dispose test

This commit is contained in:
linnil1 2017-01-31 15:22:54 +08:00 committed by wiredfool
parent 5a902bf8a2
commit 5b5d47863e

View File

@ -259,6 +259,28 @@ class TestFileGif(PillowTestCase):
except EOFError:
pass
def test_save_dispose(self):
out = self.tempfile('temp.gif')
im_list = [
Image.new('L', (100, 100), '#000'),
Image.new('L', (100, 100), '#111'),
Image.new('L', (100, 100), '#222'),
]
for method in range(0,4):
im_list[0].save(
out,
save_all=True,
append_images=im_list[1:],
disposal=method
)
img = Image.open(out)
try:
while True:
img.seek(img.tell() + 1)
self.assertEqual(img.disposal_method, method)
except EOFError:
pass
def test_iss634(self):
img = Image.open("Tests/images/iss634.gif")
# seek to the second frame