Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -553,7 +553,8 @@ with gr.Blocks(css=css) as demo:
|
|
| 553 |
gr.Markdown("<h1>๐ผ๏ธ Image Processor</h1>")
|
| 554 |
|
| 555 |
with gr.Row():
|
| 556 |
-
|
|
|
|
| 557 |
with gr.Group(elem_classes="panel"):
|
| 558 |
mode_toggle = gr.Radio(
|
| 559 |
["๐ Upload Workbook", "๐ค Upload Images"],
|
|
@@ -592,34 +593,41 @@ with gr.Blocks(css=css) as demo:
|
|
| 592 |
workbook_upload.change(
|
| 593 |
fn=read_uploaded_workbook,
|
| 594 |
inputs=[workbook_upload],
|
| 595 |
-
outputs=[image_data_state,
|
| 596 |
)
|
| 597 |
|
| 598 |
upload_box.change(
|
| 599 |
lambda files: f"{len(files)} files ready." if files else "No files selected",
|
| 600 |
[upload_box],
|
| 601 |
-
[
|
| 602 |
)
|
| 603 |
|
|
|
|
| 604 |
process_btn = gr.Button("โ๏ธ Process", elem_id="process-btn-url")
|
| 605 |
|
|
|
|
| 606 |
with gr.Group(elem_classes="panel"):
|
| 607 |
format_choice = gr.Dropdown(
|
| 608 |
["JPEG", "PNG", "WEBP", "TIFF", "GIF", "JFIF", "AVIF"],
|
| 609 |
-
label="๐ผ๏ธ Format", value="JPEG"
|
| 610 |
)
|
| 611 |
-
width = gr.Number(label="
|
| 612 |
-
height = gr.Number(label="
|
| 613 |
|
|
|
|
| 614 |
with gr.Row(elem_classes="btn-row"):
|
| 615 |
stop_btn = gr.Button("Stop", elem_id="stop-btn")
|
| 616 |
clear_btn = gr.Button("Clear", elem_id="clear-btn")
|
| 617 |
|
| 618 |
-
|
|
|
|
| 619 |
status = gr.Textbox(
|
| 620 |
-
label="๐ฃ Status", lines=
|
| 621 |
)
|
| 622 |
|
|
|
|
|
|
|
|
|
|
| 623 |
with gr.Group(elem_classes="panel"):
|
| 624 |
zip_download_btn = gr.Button("๐ฆ Download ZIP")
|
| 625 |
zip_file_hidden = gr.File(visible=False)
|
|
|
|
| 553 |
gr.Markdown("<h1>๐ผ๏ธ Image Processor</h1>")
|
| 554 |
|
| 555 |
with gr.Row():
|
| 556 |
+
# === LEFT SIDE: Inputs ===
|
| 557 |
+
with gr.Column(scale=3, min_width=500):
|
| 558 |
with gr.Group(elem_classes="panel"):
|
| 559 |
mode_toggle = gr.Radio(
|
| 560 |
["๐ Upload Workbook", "๐ค Upload Images"],
|
|
|
|
| 593 |
workbook_upload.change(
|
| 594 |
fn=read_uploaded_workbook,
|
| 595 |
inputs=[workbook_upload],
|
| 596 |
+
outputs=[image_data_state, gr.Textbox.update()]
|
| 597 |
)
|
| 598 |
|
| 599 |
upload_box.change(
|
| 600 |
lambda files: f"{len(files)} files ready." if files else "No files selected",
|
| 601 |
[upload_box],
|
| 602 |
+
[gr.Textbox.update()]
|
| 603 |
)
|
| 604 |
|
| 605 |
+
# PROCESS button right after inputs
|
| 606 |
process_btn = gr.Button("โ๏ธ Process", elem_id="process-btn-url")
|
| 607 |
|
| 608 |
+
# FORMAT options below Process button
|
| 609 |
with gr.Group(elem_classes="panel"):
|
| 610 |
format_choice = gr.Dropdown(
|
| 611 |
["JPEG", "PNG", "WEBP", "TIFF", "GIF", "JFIF", "AVIF"],
|
| 612 |
+
label="๐ผ๏ธ Format", value="JPEG"
|
| 613 |
)
|
| 614 |
+
width = gr.Number(label="Width (px)", value=1000, precision=0)
|
| 615 |
+
height = gr.Number(label="Height (px)", value=1000, precision=0)
|
| 616 |
|
| 617 |
+
# Buttons at the bottom
|
| 618 |
with gr.Row(elem_classes="btn-row"):
|
| 619 |
stop_btn = gr.Button("Stop", elem_id="stop-btn")
|
| 620 |
clear_btn = gr.Button("Clear", elem_id="clear-btn")
|
| 621 |
|
| 622 |
+
# === RIGHT SIDE: Status & Output ===
|
| 623 |
+
with gr.Column(scale=2, min_width=400):
|
| 624 |
status = gr.Textbox(
|
| 625 |
+
label="๐ฃ Status", lines=18, interactive=False, elem_id="status-box"
|
| 626 |
)
|
| 627 |
|
| 628 |
+
with gr.Group(elem_classes="panel"):
|
| 629 |
+
zip_download_btn = gr.Button("๐ฆ
|
| 630 |
+
|
| 631 |
with gr.Group(elem_classes="panel"):
|
| 632 |
zip_download_btn = gr.Button("๐ฆ Download ZIP")
|
| 633 |
zip_file_hidden = gr.File(visible=False)
|