Update app.py
Browse files
app.py
CHANGED
|
@@ -21,11 +21,20 @@ def blob_to_base64_html(blob_data):
|
|
| 21 |
return ""
|
| 22 |
try:
|
| 23 |
if isinstance(blob_data, (bytes, bytearray)):
|
| 24 |
-
# ๋งค๋ฒ ์ค์๊ฐ์ผ๋ก ๋ณํํฉ๋๋ค.
|
| 25 |
encoded = base64.b64encode(blob_data).decode('utf-8')
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
return str(blob_data)
|
| 30 |
except Exception:
|
| 31 |
return str(blob_data)
|
|
|
|
| 21 |
return ""
|
| 22 |
try:
|
| 23 |
if isinstance(blob_data, (bytes, bytearray)):
|
|
|
|
| 24 |
encoded = base64.b64encode(blob_data).decode('utf-8')
|
| 25 |
+
return f"""
|
| 26 |
+
<img src="data:image/png;base64,{encoded}"
|
| 27 |
+
style="
|
| 28 |
+
width:100%;
|
| 29 |
+
max-width:1000px;
|
| 30 |
+
height:auto;
|
| 31 |
+
display:block;
|
| 32 |
+
margin:10px 0;
|
| 33 |
+
cursor: zoom-in;
|
| 34 |
+
"
|
| 35 |
+
onclick="window.open(this.src)"
|
| 36 |
+
>
|
| 37 |
+
"""
|
| 38 |
return str(blob_data)
|
| 39 |
except Exception:
|
| 40 |
return str(blob_data)
|