mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-25 22:54:46 +03:00
Merge ba8f59107d
into 8458641bb8
This commit is contained in:
commit
e6bcbb9a17
|
@ -535,8 +535,9 @@ def _write_local_header(fp, im, offset, flags):
|
|||
o8(transparency) + # transparency index
|
||||
o8(0))
|
||||
|
||||
if "comment" in im.encoderinfo and \
|
||||
1 <= len(im.encoderinfo["comment"]) <= 255:
|
||||
if "comment" in im.encoderinfo \
|
||||
and im.encoderinfo["comment"] is not None \
|
||||
and 1 <= len(im.encoderinfo["comment"]) <= 255:
|
||||
fp.write(b"!" +
|
||||
o8(254) + # extension intro
|
||||
o8(len(im.encoderinfo["comment"])) +
|
||||
|
@ -702,7 +703,8 @@ 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
|
||||
(extensionKey == "comment"
|
||||
and info[extensionKey] is not None and
|
||||
not (1 <= len(info[extensionKey]) <= 255))):
|
||||
continue
|
||||
version = b"89a"
|
||||
|
|
Loading…
Reference in New Issue
Block a user