Skip to content

Commit 62d5817

Browse files
committed
Changed delimiter to \n
1 parent 44c6467 commit 62d5817

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Tests/test_file_gif.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -813,10 +813,10 @@ def test_zero_comment_subblocks():
813813
assert_image_equal_tofile(im, TEST_GIF)
814814

815815

816-
def test_read_multiple_comments():
816+
def test_read_multiple_comment_blocks():
817817
with Image.open("Tests/images/multiple_comments.gif") as im:
818-
# Multiple comments in a frame are separated not concatenated
819-
assert im.info["comment"] == b"Test comment 1\r\nTest comment 2"
818+
# Multiple comment blocks in a frame are separated not concatenated
819+
assert im.info["comment"] == b"Test comment 1\nTest comment 2"
820820

821821

822822
def test_version(tmp_path):

src/PIL/GifImagePlugin.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,16 @@ def _seek(self, frame, update_image=True):
228228
#
229229
# comment extension
230230
#
231-
# Collect one comment block
232231
comment = b""
232+
233+
# Collect one comment block
233234
while block:
234235
comment += block
235236
block = self.data()
236237

237-
# If multiple comments in frame, separate in info with \r\n
238238
if "comment" in info:
239-
info["comment"] += b"\r\n" + comment
239+
# If multiple comment blocks in frame, separate with \n
240+
info["comment"] += b"\n" + comment
240241
else:
241242
info["comment"] = comment
242243
s = None

0 commit comments

Comments
 (0)