Merge pull request #406 from wiredfool/gif-save

Roundtrip tests for saving Gifs
This commit is contained in:
wiredfool 2013-11-12 11:21:00 -08:00
commit b4cf30f7fa

View File

@ -27,3 +27,22 @@ def test_optimize():
return len(file.getvalue())
assert_equal(test(0), 800)
assert_equal(test(1), 38)
def test_roundtrip():
out = tempfile('temp.gif')
im = lena()
im.save(out)
reread = Image.open(out)
assert_image_similar(reread.convert('RGB'), im, 50)
def test_roundtrip2():
#see https://github.com/python-imaging/Pillow/issues/403
out = 'temp.gif'#tempfile('temp.gif')
im = Image.open('Images/lena.gif')
im2 = im.copy()
im2.save(out)
reread = Image.open(out)
assert_image_similar(reread.convert('RGB'), lena(), 50)