Commit graph

1 commit

Author SHA1 Message Date
jedarden
98964e06fe fix(pdftract-2j4zl): fix header/footer duplicate counting bug
The detect_headers_and_footers function was incrementing classified_count
every time a block was classified, even if it was already classified from
a previous sliding window iteration. With 10 pages and identical headers,
blocks on pages 1-9 would be reclassified multiple times (31 classifications
instead of 10).

Fixed by checking if block is already "header" or "footer" before incrementing
the counter.

All 25 header_footer tests now pass.

Refs: pdftract-2j4zl

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 00:04:13 -04:00