Skip to content

fix: round Jina CLIP crop offsets to match Jina's reference - #731

Merged
joein merged 1 commit into
mainfrom
fix-jina-clip-crop-offset
Sep 25, 2026
Merged

joein merged 1 commit into
mainfrom
fix-jina-clip-crop-offset

Conversation

@joein

@joein joein commented Sep 25, 2026

Copy link
Copy Markdown
Member

No description provided.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: d9e368d3-8b22-4028-abb2-1efef0e9024c

📥 Commits

Reviewing files that changed from the base of the PR and between 92aa6a5 and c3e616e.

📒 Files selected for processing (1)
  • fastembed/image/transform/functional.py

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

pad2square now uses round() instead of floor division to calculate centered crop offsets when an image dimension exceeds the target size. The crop bounds and subsequent padding behavior remain unchanged.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: serhiizghama

Architecture Summary

Architecture risk: 🔵 Low · up to c3e61

The change affects 1 system.

Changed systems: fastembed

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — fastembed (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in fastembed/image/transform/functional.py: pad2square replaces floor-divided crop offsets with round((dimension - size) / 2) for dimensions larger than size; the crop bounds and subsequent padding behavior are unchanged.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No pull request description was provided, so the description does not provide meaningful context about the changes. Add a brief description that explains the change to pad2square crop offset rounding and its purpose of matching Jina's reference behavior.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the change to round Jina CLIP crop offsets and matches the implementation summary.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@joein
joein merged commit d0b0478 into main Sep 25, 2026
10 checks passed
@joein
joein deleted the fix-jina-clip-crop-offset branch September 25, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant