GiantPandas commited on
Commit
176f7cb
·
verified ·
1 Parent(s): c1d0d10

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -30
app.py CHANGED
@@ -298,36 +298,36 @@ def render_img(b64_list, idx, scale):
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;align-items: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 (
 
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 (