Repository navigation
Fixed bug: Prevent 400 errors from Image2Text providers by skipping images smaller than 11px on any side during figure enhancement. - #12868
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the vision LLM image-description path by skipping extremely small figure crops that would cause provider-side 400 errors due to minimum image size constraints.
Changes:
- Added a minimum-side-length guard (11px) in
vision_llm_chunkto detect tiny images before sending them to the Image2Text/VLM provider. - On detecting a tiny image, now report via
callbackand return an empty string, allowing figure enhancement to continue instead of aborting on provider errors.
KevinHuSh
marked this pull request as draft
January 28, 2026 06:10
KevinHuSh
marked this pull request as ready for review
January 28, 2026 06:10
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.
What problem does this PR solve?
During figure enhancement, some cropped figure images are extremely small. Sending these to the Image2Text/VLM provider fails with a 400 invalid_parameter_error because the image width/height must
be >10px. This aborts the enhancement step. This PR adds a minimal size guard to skip tiny crops and continue processing.

Type of change