diff --git a/Tests/test_file_gif.py b/Tests/test_file_gif.py index c8f3836fc..b1006a630 100644 --- a/Tests/test_file_gif.py +++ b/Tests/test_file_gif.py @@ -305,9 +305,12 @@ class TestFileGif(PillowTestCase): out = self.tempfile('temp.gif') im = Image.new('L', (100, 100), '#000') - im.save(out, duration=duration) - reread = Image.open(out) + # Check that the argument has priority over the info settings + im.info['duration'] = 100 + im.save(out, duration=duration) + + reread = Image.open(out) self.assertEqual(reread.info['duration'], duration) def test_multiple_duration(self): diff --git a/src/PIL/GifImagePlugin.py b/src/PIL/GifImagePlugin.py index c01adff88..1bfbb5ffd 100644 --- a/src/PIL/GifImagePlugin.py +++ b/src/PIL/GifImagePlugin.py @@ -457,7 +457,8 @@ def _save_all(im, fp, filename): def _save(im, fp, filename, save_all=False): - im.encoderinfo.update(im.info) + for k, v in im.info.items(): + im.encoderinfo.setdefault(k, v) # header try: palette = im.encoderinfo["palette"]