Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -298,36 +298,36 @@ def render_img(b64_list, idx, scale):
|
|
| 298 |
|
| 299 |
if scale <= 1:
|
| 300 |
# ---------- 居中模式 ----------
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
return f"""
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
else:
|
| 332 |
# ---------- 放大模式 ----------
|
| 333 |
return (
|
|
|
|
| 298 |
|
| 299 |
if scale <= 1:
|
| 300 |
# ---------- 居中模式 ----------
|
| 301 |
+
return (
|
| 302 |
+
f'<div style="overflow:auto;border:1px solid #ccc;'
|
| 303 |
+
f'display:flex;justify-content:center;'
|
| 304 |
+
f'width:100%;height:800px;">'
|
| 305 |
+
f' <img src="{src}" '
|
| 306 |
+
f' style="width:{percent}%;max-width:none;'
|
| 307 |
+
f' height:auto;display:block;" />'
|
| 308 |
+
f'</div>'
|
| 309 |
+
)
|
| 310 |
+
|
| 311 |
+
# return f"""
|
| 312 |
+
# <div style="
|
| 313 |
+
# width:100%;
|
| 314 |
+
# height:800px;
|
| 315 |
+
# overflow:auto;
|
| 316 |
+
# border:1px solid #ccc;
|
| 317 |
+
# ">
|
| 318 |
+
# <div style="
|
| 319 |
+
# min-width:100%; /* 保证外层 div 至少跟容器一样宽 */
|
| 320 |
+
# display:flex;
|
| 321 |
+
# justify-content:center; /* 小图水平居中 */
|
| 322 |
+
# ">
|
| 323 |
+
# <img src="{src}" style="
|
| 324 |
+
# width:{percent}%;
|
| 325 |
+
# height:auto;
|
| 326 |
+
# display:block;
|
| 327 |
+
# ">
|
| 328 |
+
# </div>
|
| 329 |
+
# </div>
|
| 330 |
+
# """
|
| 331 |
else:
|
| 332 |
# ---------- 放大模式 ----------
|
| 333 |
return (
|