Workpam commited on
Commit
fb8f9dc
Β·
verified Β·
1 Parent(s): fb5179a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -8
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
- with gr.Column(scale=2, min_width=500):
 
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, status]
596
  )
597
 
598
  upload_box.change(
599
  lambda files: f"{len(files)} files ready." if files else "No files selected",
600
  [upload_box],
601
- [status]
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", scale=1
610
  )
611
- width = gr.Number(label=" Width (px)", value=1000, precision=0, scale=1)
612
- height = gr.Number(label=" Height (px)", value=1000, precision=0, scale=1)
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
- with gr.Column(scale=1, min_width=300):
 
619
  status = gr.Textbox(
620
- label="πŸ“£ Status", lines=16, interactive=False, elem_id="status-box"
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)