mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Merge pull request #3086 from radarhere/info
Change encoderinfo to have priority over info when saving GIF images
This commit is contained in:
commit
215b0e0833
|
@ -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):
|
||||
|
|
|
@ -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"]
|
||||
|
|
Loading…
Reference in New Issue
Block a user