Skip to content

Fix Resize crop path ignoring upscale: false - #886

Merged
kean merged 1 commit into
mainfrom
fix/resize-crop-honors-upscale
Aug 15, 2026
Merged

kean merged 1 commit into
mainfrom
fix/resize-crop-honors-upscale

Conversation

@kean

@kean kean commented Aug 15, 2026

Copy link
Copy Markdown
Owner

ImageProcessors.Resize never forwarded upscale to byResizingAndCropping, so crop: true always enlarged images smaller than the target (contradicting the docs), and produced two cache entries with identical content for upscale: true/false.

upscale is now forwarded and honored: with upscale: false the image is cropped to the target aspect ratio at its native resolution instead of being enlarged. Downscaling and upscale: true are unchanged.

Adds coverage in ResizeTests.

The crop path never forwarded `upscale` to `byResizingAndCropping`, so an
image smaller than the target was always enlarged. It's now cropped to the
target aspect ratio at its native resolution instead.
@kean
kean merged commit e94ba92 into main Aug 15, 2026
5 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