Support iPhone MPO photos

This commit is contained in:
2026-09-20 02:42:07 +03:30
parent dcdeafaae1
commit 2a48de971a
3 changed files with 11 additions and 5 deletions
+6 -1
View File
@@ -162,13 +162,18 @@ def test_tiff_and_invalid_color_profile_are_accepted(service):
invalid_profile = io.BytesIO()
Image.new("RGB", (40, 20), "purple").save(
invalid_profile, "JPEG", icc_profile=b"not an ICC profile")
mpo = io.BytesIO()
Image.new("RGB", (40, 20), "red").save(
mpo, "MPO", save_all=True, append_images=[Image.new("RGB", (40, 20), "blue")])
for raw in (photo(format="TIFF"), invalid_profile.getvalue()):
for raw in (photo(format="TIFF"), invalid_profile.getvalue(), mpo.getvalue()):
response = upload(client, [raw])
assert response.status_code == 202
output = data / "submissions" / response.json["id"] / "images/00.jpg"
with Image.open(output) as image:
assert image.format == "JPEG"
if raw == mpo.getvalue():
assert image.getpixel((0, 0))[0] > image.getpixel((0, 0))[2]
def test_heic_format_label_is_accepted(service, monkeypatch):