Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -113,7 +113,7 @@ def extract_invoice_data(file_data, content_type, json_schema):
|
|
| 113 |
img_byte_arr = io.BytesIO()
|
| 114 |
img.save(img_byte_arr, format="PNG", dpi=(300, 300))
|
| 115 |
base64_encoded = base64.b64encode(img_byte_arr.getvalue()).decode('utf-8')
|
| 116 |
-
base64_images.append(f"data:
|
| 117 |
|
| 118 |
except Exception as e:
|
| 119 |
logger.error(f"Error converting PDF to image: {e}")
|
|
|
|
| 113 |
img_byte_arr = io.BytesIO()
|
| 114 |
img.save(img_byte_arr, format="PNG", dpi=(300, 300))
|
| 115 |
base64_encoded = base64.b64encode(img_byte_arr.getvalue()).decode('utf-8')
|
| 116 |
+
base64_images.append(f"data:image/png;base64,{base64_encoded}")
|
| 117 |
|
| 118 |
except Exception as e:
|
| 119 |
logger.error(f"Error converting PDF to image: {e}")
|