Support iPhone MPO photos
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user