nsfwalex commited on
Commit
a402a67
โ€ข
1 Parent(s): a781687

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -164,13 +164,13 @@ window.postMessageToParent = function(img, event, source, value) {
164
  window.cur_process_step = "process";
165
  return img;
166
  }
167
- function uploadImage(images, event, source, value) {
168
  // Ensure we're in an iframe
169
  if (window.cur_process_step != "process"){
170
  return;
171
  }
172
  window.cur_process_step = "";
173
- console.log("uploadImage", images && images.length > 0 ? images[0].image.url : null, event, source, value);
174
  // Get the first image from the gallery (assuming it's an array)
175
  let imageUrl = images && images.length > 0 ? images[0].image.url : null;
176
  if (window.self !== window.top) {
@@ -222,8 +222,8 @@ with gr.Blocks(css=css, head=js) as demo:
222
  height=340
223
 
224
  with gr.Row(equal_height=False):
225
- gr.HTML(value=desc_html, elem_id='pitch_desc_html_code')
226
  with gr.Column(min_width=240): # Adjust scale for proper sizing
 
227
  image_input = gr.Image(type="numpy", label="Upload Image", height=height)
228
  gr.Examples(examples=examples, inputs=image_input, examples_per_page=10, elem_id="example_img")
229
  process_button = gr.Button("Go!")#,size="sm"
 
164
  window.cur_process_step = "process";
165
  return img;
166
  }
167
+ function uploadImage(image, event, source, value) {
168
  // Ensure we're in an iframe
169
  if (window.cur_process_step != "process"){
170
  return;
171
  }
172
  window.cur_process_step = "";
173
+ console.log("uploadImage", image ? image.url : null, event, source, value);
174
  // Get the first image from the gallery (assuming it's an array)
175
  let imageUrl = images && images.length > 0 ? images[0].image.url : null;
176
  if (window.self !== window.top) {
 
222
  height=340
223
 
224
  with gr.Row(equal_height=False):
 
225
  with gr.Column(min_width=240): # Adjust scale for proper sizing
226
+ gr.HTML(value=desc_html, elem_id='pitch_desc_html_code')
227
  image_input = gr.Image(type="numpy", label="Upload Image", height=height)
228
  gr.Examples(examples=examples, inputs=image_input, examples_per_page=10, elem_id="example_img")
229
  process_button = gr.Button("Go!")#,size="sm"