mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Changed delimiter to \n
This commit is contained in:
parent
44c6467400
commit
62d5817e29
|
@ -813,10 +813,10 @@ def test_zero_comment_subblocks():
|
|||
assert_image_equal_tofile(im, TEST_GIF)
|
||||
|
||||
|
||||
def test_read_multiple_comments():
|
||||
def test_read_multiple_comment_blocks():
|
||||
with Image.open("Tests/images/multiple_comments.gif") as im:
|
||||
# Multiple comments in a frame are separated not concatenated
|
||||
assert im.info["comment"] == b"Test comment 1\r\nTest comment 2"
|
||||
# Multiple comment blocks in a frame are separated not concatenated
|
||||
assert im.info["comment"] == b"Test comment 1\nTest comment 2"
|
||||
|
||||
|
||||
def test_version(tmp_path):
|
||||
|
|
|
@ -228,15 +228,16 @@ class GifImageFile(ImageFile.ImageFile):
|
|||
#
|
||||
# comment extension
|
||||
#
|
||||
# Collect one comment block
|
||||
comment = b""
|
||||
|
||||
# Collect one comment block
|
||||
while block:
|
||||
comment += block
|
||||
block = self.data()
|
||||
|
||||
# If multiple comments in frame, separate in info with \r\n
|
||||
if "comment" in info:
|
||||
info["comment"] += b"\r\n" + comment
|
||||
# If multiple comment blocks in frame, separate with \n
|
||||
info["comment"] += b"\n" + comment
|
||||
else:
|
||||
info["comment"] = comment
|
||||
s = None
|
||||
|
|
Loading…
Reference in New Issue
Block a user