From 1f8a37841c91e45f48587319e5e14aee9f575fe8 Mon Sep 17 00:00:00 2001 From: Anton Vlasenko Date: Fri, 24 Jul 2015 11:14:20 +0200 Subject: [PATCH] Testing that animated gif preserves all important headers --- Tests/test_file_gif.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Tests/test_file_gif.py b/Tests/test_file_gif.py index 70438eb03..5c83ba8e4 100644 --- a/Tests/test_file_gif.py +++ b/Tests/test_file_gif.py @@ -95,6 +95,21 @@ class TestFileGif(PillowTestCase): self.assertEqual(reread.n_frames, 5) + def test_headers_saving_for_animated_gifs(self): + important_headers = ['background', 'version', 'transparency', 'duration', 'loop'] + # Multiframe image + im = Image.open("Tests/images/dispose_bgnd.gif") + + out = self.tempfile('temp.gif') + im.save(out, save_all=True) + reread = Image.open(out) + + for header in important_headers: + self.assertEqual( + im.info[header], + reread.info[header] + ) + def test_palette_handling(self): # see https://github.com/python-pillow/Pillow/issues/513