fix: close library upload flow and harden image storage
This commit is contained in:
@@ -177,7 +177,9 @@ class TemplateRenderer:
|
||||
elif block["kind"] == "photo":
|
||||
asset_id = values.get("photo_id")
|
||||
if asset_id:
|
||||
with Image.open(self.assets.path(asset_id)) as photo:
|
||||
with Image.open(
|
||||
self.assets.path(asset_id), formats=("JPEG", "PNG", "WEBP")
|
||||
) as photo:
|
||||
img.paste(ImageOps.fit(photo.convert("RGB"), (w, h)), (x, y))
|
||||
else:
|
||||
draw.rectangle((x, y, x + w, y + h), outline="black", width=5)
|
||||
|
||||
Reference in New Issue
Block a user