Closed hheexx closed 5 years ago
I don't believe there's anything misleading about the name. It resizes to the max of your requested width or height while maintaining aspect ratio. All modes will upscale or downscale as necessary to meet your requested output dimensions.
If you wish to prevent upscaling entirely, you can use ImageFileInfo
to inspect your source image before resizing and clamp the requested output size to be no larger than the input.
Found ImageFileInfo class now. It works. Consider adding boolean to settings to disable upscaling. I think it may be common need...
Thanks!
Yep, that sounds reasonable. I built that option into the WebRSize module but it makes sense to get it moved into the main processor.
FYI, I decided to update the behavior of CropScaleMode.Max
so it no longer upscales starting from v0.10.0. There is a new CropScaleMode.Contain
that maintains the old behavior.
As I thought CropScaleMode.Max only downscales images if needed. Looks like it also upscales so name is a little misleading.
Is there a mode that only downscales if needed?