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
+2 -2
View File
@@ -128,9 +128,9 @@ def public_text(text):
def web_image(raw, destination):
with Image.open(io.BytesIO(raw)) as original:
if original.format not in {"JPEG", "PNG", "WEBP", "HEIF", "HEIC", "AVIF", "TIFF"}:
if original.format not in {"JPEG", "MPO", "PNG", "WEBP", "HEIF", "HEIC", "AVIF", "TIFF"}:
raise ValueError(
f"Detected {original.format or 'unknown'}; use JPEG, PNG, WebP, "
f"Detected {original.format or 'unknown'}; use JPEG/MPO, PNG, WebP, "
"HEIF/HEIC, AVIF, or TIFF photos")
taken_at = exif_photo_date(original.getexif())
image = ImageOps.exif_transpose(original)