Mageia commited on
Commit
aff59fd
·
unverified ·
1 Parent(s): 86b715d

fix: Gallery

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -121,9 +121,13 @@ with gr.Blocks() as demo:
121
  image_gallery = gr.Gallery(
122
  label="PDF页面预览",
123
  columns=3,
124
- height=300,
125
- object_fit="contain", # 添加这个参数
126
- preview=True, # 添加这个参数
 
 
 
 
127
  )
128
  selected_index = gr.State(None)
129
  pdf_input.upload(fn=process_pdf, inputs=pdf_input, outputs=image_gallery)
 
121
  image_gallery = gr.Gallery(
122
  label="PDF页面预览",
123
  columns=3,
124
+ height=600,
125
+ object_fit="contain",
126
+ preview=True,
127
+ zoom=True, # 启用缩放功能
128
+ show_download_button=True, # 显示下载按钮
129
+ show_fullscreen_button=True, # 显示全屏按钮
130
+ allow_preview=True, # 允许预览(包括全屏查看)
131
  )
132
  selected_index = gr.State(None)
133
  pdf_input.upload(fn=process_pdf, inputs=pdf_input, outputs=image_gallery)