mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Always use GIF89a for long comments
Fix bug that allows GIFs with long comments to be written as GIF87a.
This commit is contained in:
parent
9c580ce649
commit
b3d29e946a
|
@ -804,8 +804,9 @@ def test_comment_over_255(tmp_path):
|
|||
im.info["comment"] = comment
|
||||
im.save(out)
|
||||
with Image.open(out) as reread:
|
||||
|
||||
assert reread.info["comment"] == comment
|
||||
# Test that GIF89a is used for long comment
|
||||
assert reread.info["version"] == b"GIF89a"
|
||||
|
||||
|
||||
def test_zero_comment_subblocks():
|
||||
|
|
|
@ -915,7 +915,7 @@ def _get_global_header(im, info):
|
|||
for extensionKey in ["transparency", "duration", "loop", "comment"]:
|
||||
if info and extensionKey in info:
|
||||
if (extensionKey == "duration" and info[extensionKey] == 0) or (
|
||||
extensionKey == "comment" and not (1 <= len(info[extensionKey]) <= 255)
|
||||
extensionKey == "comment" and len(info[extensionKey]) == 0
|
||||
):
|
||||
continue
|
||||
version = b"89a"
|
||||
|
|
Loading…
Reference in New Issue
Block a user