支持MPO多镜头JPG照片上传

This commit is contained in:
2026-11-19 15:14:14 +08:00
parent d82e9dc407
commit 21e7881344
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -227,7 +227,7 @@ def convert_photo(raw):
with warnings.catch_warnings():
warnings.simplefilter('error', Image.DecompressionBombError)
with Image.open(io.BytesIO(raw)) as image:
if image.format not in ('JPEG', 'PNG', 'WEBP'):
if image.format not in ('JPEG', 'MPO', 'PNG', 'WEBP'):
raise ValueError('仅支持JPG、PNG、WebP照片')
image = ImageOps.exif_transpose(image).convert('RGB')
output = io.BytesIO(); image.save(output, 'JPEG', quality=90)