Merge pull request #4613 from uploadcare/jpeg-icc-after-SOF

JPEG: Truncate icclist instead of setting to None
This commit is contained in:
Andrew Murray 2020-05-10 10:49:26 +10:00 committed by GitHub
commit cd0efc6c9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

View File

@ -689,6 +689,10 @@ class TestFileJpeg:
apps_13_lengths = [len(v) for k, v in im.applist if k == "APP13"]
assert [65504, 24] == apps_13_lengths
def test_icc_after_SOF(self):
with Image.open("Tests/images/icc-after-SOF.jpg") as im:
assert im.info["icc_profile"] == b"profile"
@pytest.mark.skipif(not is_win32(), reason="Windows only")
@skip_unless_feature("jpg")

View File

@ -221,7 +221,7 @@ def SOF(self, marker):
else:
icc_profile = None # wrong number of fragments
self.info["icc_profile"] = icc_profile
self.icclist = None
self.icclist = []
for i in range(6, len(s), 3):
t = s[i : i + 3]