Update app.py
Browse files
app.py
CHANGED
|
@@ -22,17 +22,12 @@ def blob_to_base64_html(blob_data):
|
|
| 22 |
try:
|
| 23 |
if isinstance(blob_data, (bytes, bytearray)):
|
| 24 |
encoded = base64.b64encode(blob_data).decode('utf-8')
|
| 25 |
-
# ๐ก [ํต์ฌ]
|
| 26 |
-
# width
|
| 27 |
-
return f""
|
| 28 |
-
<div style="width: 1200px !important; margin: 10px 0;">
|
| 29 |
-
<img src='data:image/png;base64,{encoded}'
|
| 30 |
-
style='width: 100% !important; height: auto !important; display: block; border: 1px solid #ddd;' />
|
| 31 |
-
</div>
|
| 32 |
-
"""
|
| 33 |
return str(blob_data)
|
| 34 |
except Exception as e:
|
| 35 |
-
return str(
|
| 36 |
|
| 37 |
def safe_text_factory(x):
|
| 38 |
"""ํ
์คํธ ๋์ฝ๋ฉ์ ์๋ํ๊ณ , ์คํจํ๋ฉด(PNG ๋ฑ ์ด๋ฏธ์ง์ผ ๊ฒฝ์ฐ) ์๋ณธ ๋ฐ์ดํธ๋ฅผ ๊ทธ๋๋ก ๋ฐํ"""
|
|
|
|
| 22 |
try:
|
| 23 |
if isinstance(blob_data, (bytes, bytearray)):
|
| 24 |
encoded = base64.b64encode(blob_data).decode('utf-8')
|
| 25 |
+
# ๐ก [ํต์ฌ] div๋ฅผ ์ ๊ฑฐํ๊ณ ์ค์ง img ํ๊ทธ๋ง 'ํ ์ค๋ก' ๋ฐํํฉ๋๋ค.
|
| 26 |
+
# width๋ฅผ 1200px๋ก ๋ฐ์๋ฒ๋ฆฌ๋ฉด ๋น์จ ๋ง์ถฐ์ ์์ฃผ ํฌ๊ฒ ๋์ต๋๋ค.
|
| 27 |
+
return f"<img src='data:image/png;base64,{encoded}' style='width:1200px !important; max-width:none !important; height:auto !important; display:block;' />"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
return str(blob_data)
|
| 29 |
except Exception as e:
|
| 30 |
+
return str(blob_dat
|
| 31 |
|
| 32 |
def safe_text_factory(x):
|
| 33 |
"""ํ
์คํธ ๋์ฝ๋ฉ์ ์๋ํ๊ณ , ์คํจํ๋ฉด(PNG ๋ฑ ์ด๋ฏธ์ง์ผ ๊ฒฝ์ฐ) ์๋ณธ ๋ฐ์ดํธ๋ฅผ ๊ทธ๋๋ก ๋ฐํ"""
|