mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-10-29 23:17:49 +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) |         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: |     with Image.open("Tests/images/multiple_comments.gif") as im: | ||||||
|         # Multiple comments in a frame are separated not concatenated |         # Multiple comment blocks in a frame are separated not concatenated | ||||||
|         assert im.info["comment"] == b"Test comment 1\r\nTest comment 2" |         assert im.info["comment"] == b"Test comment 1\nTest comment 2" | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def test_version(tmp_path): | def test_version(tmp_path): | ||||||
|  |  | ||||||
|  | @ -228,15 +228,16 @@ class GifImageFile(ImageFile.ImageFile): | ||||||
|                     # |                     # | ||||||
|                     # comment extension |                     # comment extension | ||||||
|                     # |                     # | ||||||
|                     # Collect one comment block |  | ||||||
|                     comment = b"" |                     comment = b"" | ||||||
|  | 
 | ||||||
|  |                     # Collect one comment block | ||||||
|                     while block: |                     while block: | ||||||
|                         comment += block |                         comment += block | ||||||
|                         block = self.data() |                         block = self.data() | ||||||
| 
 | 
 | ||||||
|                     # If multiple comments in frame, separate in info with \r\n |  | ||||||
|                     if "comment" in info: |                     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: |                     else: | ||||||
|                         info["comment"] = comment |                         info["comment"] = comment | ||||||
|                     s = None |                     s = None | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user