Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
|
|
|
|
|
|
|
|
|
| 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:
|