fix(paddleocr): load all PDF pages for image cropping instead of first 100#13811
Merged
yingfeng merged 1 commit intoinfiniflow:mainfrom Mar 27, 2026
Merged
Conversation
…t 100 The __images__ method defaulted to page_to=100, but the PaddleOCR API processes all pages of the PDF. For PDFs with more than 100 pages, page indices beyond 99 were rejected as out of range during crop validation. Closes infiniflow#13803 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13811 +/- ##
===========================================
+ Coverage 49.52% 96.72% +47.19%
===========================================
Files 45 10 -35
Lines 9657 702 -8955
Branches 112 112
===========================================
- Hits 4783 679 -4104
+ Misses 4864 5 -4859
- Partials 10 18 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #13803
The
__images__method inpaddleocr_parser.pydefaulted topage_to=100, only loading the first 100 pages for image cropping. However, the PaddleOCR API processes all pages of the PDF. For PDFs with more than 100 pages, page indices beyond 99 were rejected as out of range during crop validation, causing content loss.Root Cause
Fix
Changed
page_todefault from100to10**9, so all PDF pages are loaded for cropping. Python's list slicing safely handles oversized indices.Test plan
🤖 Generated with Claude Code