Spaces:
Sleeping
Sleeping
riabayonaor
commited on
Commit
•
a6596ee
1
Parent(s):
4f83259
Update app.py
Browse files
app.py
CHANGED
@@ -38,6 +38,9 @@ if uploaded_file is not None:
|
|
38 |
if st.button("Generar Respuesta"):
|
39 |
# Convertir la imagen a bytes
|
40 |
img_bytes = io.BytesIO()
|
|
|
|
|
|
|
41 |
image.save(img_bytes, format='JPEG')
|
42 |
img_bytes = img_bytes.getvalue()
|
43 |
|
|
|
38 |
if st.button("Generar Respuesta"):
|
39 |
# Convertir la imagen a bytes
|
40 |
img_bytes = io.BytesIO()
|
41 |
+
# Convertir la imagen a modo RGB si tiene transparencia
|
42 |
+
if image.mode == 'RGBA':
|
43 |
+
image = image.convert('RGB')
|
44 |
image.save(img_bytes, format='JPEG')
|
45 |
img_bytes = img_bytes.getvalue()
|
46 |
|