dev-0.9.x -> main #76
1 changed files with 20 additions and 20 deletions
|
|
@ -1418,7 +1418,7 @@ def resize_image_if_needed(image_data):
|
||||||
pass
|
pass
|
||||||
# Decode the base64 image data
|
# Decode the base64 image data
|
||||||
image_bytes = base64.b64decode(image_data)
|
image_bytes = base64.b64decode(image_data)
|
||||||
image = Image.open(io.BytesIO(image_bytes))
|
with Image.open(io.BytesIO(image_bytes)) as image:
|
||||||
if image.mode not in ("RGB", "L"):
|
if image.mode not in ("RGB", "L"):
|
||||||
image = image.convert("RGB")
|
image = image.convert("RGB")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue