From b4aa0429aa0667a55a857337e167cac1cfb643de Mon Sep 17 00:00:00 2001 From: wiredfool Date: Thu, 7 Nov 2013 16:39:36 -0800 Subject: [PATCH 1/2] successful roundtrip test --- Tests/test_file_gif.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Tests/test_file_gif.py b/Tests/test_file_gif.py index 0c27865cddb..96b674b219a 100644 --- a/Tests/test_file_gif.py +++ b/Tests/test_file_gif.py @@ -27,3 +27,12 @@ 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) + From dd93820b744ec71c832ba62b594ee4065b876560 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Thu, 7 Nov 2013 16:39:57 -0800 Subject: [PATCH 2/2] Failing test for #403 --- Tests/test_file_gif.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Tests/test_file_gif.py b/Tests/test_file_gif.py index 96b674b219a..3a6478e2aff 100644 --- a/Tests/test_file_gif.py +++ b/Tests/test_file_gif.py @@ -36,3 +36,13 @@ def test_roundtrip(): 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) +