Merlintxu commited on
Commit
5d4346b
1 Parent(s): 0902d61

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -137,12 +137,16 @@ with gr.Blocks() as demo:
137
  optimize_batch_button = gr.Button("Optimizar Imágenes en ZIP")
138
 
139
  batch_output_zip = gr.File(label="Descargar ZIP de imágenes optimizadas", visible=True)
140
- batch_output_files = gr.File(label="Descargar imágenes individuales", visible=True, multiple=True)
 
 
 
 
141
 
142
  optimize_batch_button.click(
143
- fn=optimize_zip_images,
144
  inputs=[zip_input, png_optimize_batch, jpeg_quality_batch, jpeg_resolution_batch, webp_quality_batch],
145
- outputs=[batch_output_zip, batch_output_files]
146
  )
147
 
148
  demo.launch()
 
137
  optimize_batch_button = gr.Button("Optimizar Imágenes en ZIP")
138
 
139
  batch_output_zip = gr.File(label="Descargar ZIP de imágenes optimizadas", visible=True)
140
+ batch_gallery = gr.Gallery(label="Imágenes optimizadas (individuales)").style(grid=[4])
141
+
142
+ def update_gallery(zip_file, png_optimize, jpeg_quality, jpeg_resolution, webp_quality):
143
+ zip_output_path, optimized_files = optimize_zip_images(zip_file, png_optimize, jpeg_quality, jpeg_resolution, webp_quality)
144
+ return zip_output_path, optimized_files
145
 
146
  optimize_batch_button.click(
147
+ fn=update_gallery,
148
  inputs=[zip_input, png_optimize_batch, jpeg_quality_batch, jpeg_resolution_batch, webp_quality_batch],
149
+ outputs=[batch_output_zip, batch_gallery]
150
  )
151
 
152
  demo.launch()