Skip to content

fix: crop cover-fit instead of stretching portrait images - #25

Merged
constantgillet merged 1 commit into
mainfrom
fix/cover-crop-portrait-stretch
Aug 18, 2026
Merged

fix: crop cover-fit instead of stretching portrait images#25
constantgillet merged 1 commit into
mainfrom
fix/cover-crop-portrait-stretch

Conversation

@constantgillet

@constantgillet constantgillet commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Cover-fit (w + h) now thumbnails to the longer side of the cover-scaled image, then center-crops, matching ImageKit c-maintain_ratio.
  • Fixes portrait sources that were fitted into a width×width square and then stretched to the target box.
  • Adds tests that a banded portrait cover-fitted into a landscape box keeps the center (no anamorphic shrink) and that single-dimension portrait resizes keep aspect ratio.

libvips thumbnail_buffer fits a square, so sizing it to width alone
shrank portrait sources; the fallback then scaled axes independently.
@constantgillet
constantgillet merged commit c76dec8 into main Aug 18, 2026
2 checks passed
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