支持MPO多镜头JPG照片上传
This commit is contained in:
+1
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user