Skip to content

Commit

Permalink
Merge pull request #406 from wiredfool/gif-save
Browse files Browse the repository at this point in the history
Roundtrip tests for saving Gifs
  • Loading branch information
wiredfool committed Nov 12, 2013
2 parents 5f7ce44 + dd93820 commit b4cf30f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Tests/test_file_gif.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit b4cf30f

Please sign in to comment.