rehan953 commited on
Commit
55f6804
·
verified ·
1 Parent(s): f68e040

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -284,7 +284,10 @@ def run_ocr(uploaded_file):
284
  parts.append(page_md)
285
 
286
  # Always run footer band (bottom 8–12% of page)
287
- if page_num < len(page_images):
 
 
 
288
  img_path = page_images[page_num]
289
  ftr = ""
290
  if is_pdf:
 
284
  parts.append(page_md)
285
 
286
  # Always run footer band (bottom 8–12% of page)
287
+ # Only extract footer if the API actually detected a footer_start_frac via bbox.
288
+ # When footer_start_frac is None it means MaaS found no footer region — skip to
289
+ # avoid extracting body content that sits near the bottom of the page.
290
+ if footer_start_frac is not None and page_num < len(page_images):
291
  img_path = page_images[page_num]
292
  ftr = ""
293
  if is_pdf: