Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
141 |
|
142 |
optimize_batch_button.click(
|
143 |
-
fn=
|
144 |
inputs=[zip_input, png_optimize_batch, jpeg_quality_batch, jpeg_resolution_batch, webp_quality_batch],
|
145 |
-
outputs=[batch_output_zip,
|
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()
|