pub enum Method {
Scale,
Fit,
Cover,
Thumb,
}
Expand description
The method describes the way your image will be resized. The following methods are available:
Variants§
Scale
Scales the image down proportionally. You must provide either a target width
or a target height
, but not both. The scaled image will have exactly the provided width or height.
Fit
Scales the image down proportionally so that it fits within the given dimensions. You must provide both a width
and a height
. The scaled image will not exceed either of these dimensions.
Cover
Scales the image proportionally and crops it if necessary so that the result has exactly the given dimensions. You must provide both a width
and a height
. Which parts of the image are cropped away is determined automatically. An intelligent algorithm determines the most important areas of your image.
Thumb
A more advanced implementation of cover that also detects cut out images with plain backgrounds. The image is scaled down to the width
and height
you provide. If an image is detected with a free standing object it will add more background space where necessary or crop the unimportant parts.