Skip to content

Fixed bug: Prevent 400 errors from Image2Text providers by skipping images smaller than 11px on any side during figure enhancement. - #12868

Merged
KevinHuSh merged 2 commits into
infiniflow:mainfrom
LiruiYu33:main
Jan 28, 2026

Conversation

@LiruiYu33

@LiruiYu33 LiruiYu33 commented Jan 28, 2026 •

Copy link
Copy Markdown
Contributor

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.
image

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

Copilot AI review requested due to automatic review settings January 28, 2026 06:02
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jan 28, 2026
@LiruiYu33 LiruiYu33 changed the title Fixed bug:Prevent 400 errors from Image2Text providers by skipping images smaller than 11px on any side during figure enhancement. Fixed bug: Prevent 400 errors from Image2Text providers by skipping images smaller than 11px on any side during figure enhancement. Jan 28, 2026
@dosubot dosubot Bot added the 🐞 bug Something isn't working, pull request that fix bug. label Jan 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_chunk to detect tiny images before sending them to the Image2Text/VLM provider.
  • On detecting a tiny image, now report via callback and return an empty string, allowing figure enhancement to continue instead of aborting on provider errors.

@KevinHuSh KevinHuSh added the ci Continue Integration label Jan 28, 2026
@KevinHuSh
KevinHuSh marked this pull request as draft January 28, 2026 06:10
@KevinHuSh
KevinHuSh marked this pull request as ready for review January 28, 2026 06:10
@KevinHuSh
KevinHuSh merged commit c8bd413 into infiniflow:main Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants