Testing that animated gif preserves all important headers

This commit is contained in:
Anton Vlasenko 2015-07-24 11:14:20 +02:00 committed by Andrew Murray
parent e4f68d0658
commit 1f8a37841c

View File

@ -95,6 +95,21 @@ class TestFileGif(PillowTestCase):
self.assertEqual(reread.n_frames, 5) 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): def test_palette_handling(self):
# see https://github.com/python-pillow/Pillow/issues/513 # see https://github.com/python-pillow/Pillow/issues/513