Push Bot commited on
Commit
cb7ca44
·
1 Parent(s): e03ee37

Debug: add image preview (first page) with PyMuPDF/pdfium; return PDF path from debug flows; chain .then to render image

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -3442,11 +3442,11 @@ def debug_compile_uploaded_zip(zip_file):
3442
  + _pdf_to_iframe_html(pdf_path, height="700px")
3443
  )
3444
  _write_logs(LOG_PATH, logs)
3445
- return html
3446
  except Exception as e:
3447
  logs.append(f"⚠️ preview failed: {e}")
3448
  _write_logs(LOG_PATH, logs)
3449
- return f"<div>Compiled but preview failed: {e}</div>"
3450
 
3451
  # =====================
3452
  # Gradio pipeline function (ISOLATED)
 
3442
  + _pdf_to_iframe_html(pdf_path, height="700px")
3443
  )
3444
  _write_logs(LOG_PATH, logs)
3445
+ return html, str(pdf_path)
3446
  except Exception as e:
3447
  logs.append(f"⚠️ preview failed: {e}")
3448
  _write_logs(LOG_PATH, logs)
3449
+ return f"<div>Compiled but preview failed: {e}</div>", None
3450
 
3451
  # =====================
3452
  # Gradio pipeline function (ISOLATED)