mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 01:16:16 +03:00
Merge pull request #406 from wiredfool/gif-save
Roundtrip tests for saving Gifs
This commit is contained in:
commit
b4cf30f7fa
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user