fix: close library upload flow and harden image storage
This commit is contained in:
@@ -37,7 +37,9 @@ def prepare(service, content, device_id=None):
|
||||
if source.avoid_duplicates and quality["fingerprint"] in hashes:
|
||||
continue
|
||||
hashes.update([quality["sha256"], quality["fingerprint"]])
|
||||
with Image.open(BytesIO(data)) as image:
|
||||
with Image.open(
|
||||
BytesIO(data), formats=("JPEG", "PNG", "WEBP")
|
||||
) as image:
|
||||
photo = ImageOps.exif_transpose(image).convert("RGB")
|
||||
photo.thumbnail((2400, 2400))
|
||||
output = BytesIO()
|
||||
|
||||
Reference in New Issue
Block a user