Added some error handling for image uploads
This commit is contained in:
parent
557cf4ca34
commit
72be94d981
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
.venv
|
.venv
|
||||||
|
bleh
|
||||||
|
|||||||
3
app.py
3
app.py
@ -509,7 +509,8 @@ def render(md, uploaded_img_bytes=None):
|
|||||||
image = bleh_image_from_bytes(uploaded_img_bytes)
|
image = bleh_image_from_bytes(uploaded_img_bytes)
|
||||||
lines_out.append(('image', image))
|
lines_out.append(('image', image))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
lines_out.append(('text', [('text', f"[Error al procesar imágen subida: {e}]")], font, FONT_SIZE))
|
lines_out.append(('text', [('text', f"[Error al procesar imagen]")], font, FONT_SIZE))
|
||||||
|
print(f"Image processing error: {e}")
|
||||||
else:
|
else:
|
||||||
lines_out.append(('text', [('text', "[No se subió una imagen]")], font, FONT_SIZE))
|
lines_out.append(('text', [('text', "[No se subió una imagen]")], font, FONT_SIZE))
|
||||||
elif tag[0] == 'hr':
|
elif tag[0] == 'hr':
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user