Push Bot commited on
Commit
b634c27
·
1 Parent(s): 221e6a2

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
@@ -4074,11 +4074,11 @@ def debug_compile_uploaded_zip(zip_file):
4074
  + _pdf_to_iframe_html(pdf_path, height="700px")
4075
  )
4076
  _write_logs(LOG_PATH, logs)
4077
- return html
4078
  except Exception as e:
4079
  logs.append(f"⚠️ preview failed: {e}")
4080
  _write_logs(LOG_PATH, logs)
4081
- return f"<div>Compiled but preview failed: {e}</div>"
4082
 
4083
  # =====================
4084
  # Gradio pipeline function (ISOLATED)
 
4074
  + _pdf_to_iframe_html(pdf_path, height="700px")
4075
  )
4076
  _write_logs(LOG_PATH, logs)
4077
+ return html, str(pdf_path)
4078
  except Exception as e:
4079
  logs.append(f"⚠️ preview failed: {e}")
4080
  _write_logs(LOG_PATH, logs)
4081
+ return f"<div>Compiled but preview failed: {e}</div>", None
4082
 
4083
  # =====================
4084
  # Gradio pipeline function (ISOLATED)