imagor icon indicating copy to clipboard operation
imagor copied to clipboard

Crop no scale up

Open sschueller opened this issue 7 months ago • 1 comments

Hi,

Would a pull request that adds an option for the following be accepted?

I am looking for a way to crop an image but not scale it up if it is smaller than the request size. So for example:

Image is 1000 x 50 Requested is 500 x 100 Result I want is a crop to 500 x 50

Similar to fit-in this would be a special option (maybe no-upscale) to not scale up small images only crop them if one side is larger than the requested size. For a size smaller like 500 x 25 it would resize the image normally.

sschueller avatar Jun 04 '25 08:06 sschueller

A PR would be welcomed! There is already the upscale() logic for fit-in. This would be an additional no_upscale() logic for those resize option that are NOT fit-in, including

  • HALIGN is horizontal alignment of crop. Accepts left, right or center, defaults to center
  • VALIGN is vertical alignment of crop. Accepts top, bottom or middle, defaults to middle
  • smart means using smart detection of focal points

cshum avatar Jun 16 '25 06:06 cshum

This issue is stale because it has been open 30 days with no activity. Remove the stale label or add a comment, or this issue will be closed in 15 days. You can always re-open if you still feel this is still an issue. Tag @cshum for more information.

github-actions[bot] avatar Sep 30 '25 00:09 github-actions[bot]

This issue was closed because it has been stale for 15 days with no activity.

github-actions[bot] avatar Nov 14 '25 00:11 github-actions[bot]