How to use equivalent of ImageResizer scale=both in imageflow-dotnet fluent API?
Closed this issue · 3 comments
SmilingCatEntertainment commented
BuildNode.ConstrainWithin seems to be the main workhorse available for resizing operations, but I don't see a way to engage something similar to scale=both from ImageResizer to allow upscaling as well as downscaling. Is there some hidden setting that I'm not seeing?
lilith commented
There is a command_string node that accepts "&scale=both" directly:
https://github.com/imazen/imageflow/blob/master/imageflow_types/src/lib.rs#L400-L404
lilith commented
You can use .ResizerCommands("scale=both&width=100&height=100&mode=max")
in https://github.com/imazen/imageflow-dotnet/releases/tag/v0.3.4
lilith commented
You can also use .Constrain(new Constraint(ConstrainMode.Fit, w, h))
in v0.4.0