Push Bot commited on
Commit
acd3aeb
·
1 Parent(s): f1f43a2

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
@@ -2747,11 +2747,11 @@ def debug_compile_uploaded_zip(zip_file):
2747
  + _pdf_to_iframe_html(pdf_path, height="700px")
2748
  )
2749
  _write_logs(LOG_PATH, logs)
2750
- return html
2751
  except Exception as e:
2752
  logs.append(f"⚠️ preview failed: {e}")
2753
  _write_logs(LOG_PATH, logs)
2754
- return f"<div>Compiled but preview failed: {e}</div>"
2755
 
2756
  # =====================
2757
  # Gradio pipeline function (ISOLATED)
 
2747
  + _pdf_to_iframe_html(pdf_path, height="700px")
2748
  )
2749
  _write_logs(LOG_PATH, logs)
2750
+ return html, str(pdf_path)
2751
  except Exception as e:
2752
  logs.append(f"⚠️ preview failed: {e}")
2753
  _write_logs(LOG_PATH, logs)
2754
+ return f"<div>Compiled but preview failed: {e}</div>", None
2755
 
2756
  # =====================
2757
  # Gradio pipeline function (ISOLATED)