CropMode

Enumin image_optimizerfastly 0.13.1View source
pub enum CropMode {
Safe = 1,
Smart = 2,
}

Controls cropping behaviour.

Variants

Safe

= 1

Avoid invalid parameter errors and return an image.

By default, if the specified cropped region is outside the bounds of the image, then the transformation will fail with the error "Invalid transformation for requested image: Invalid crop, region out of bounds". This option will instead deliver the image as an intersection of the origin image and the specified cropped region. This avoids the error, but the resulting image may not be of the specified dimensions.

Smart

= 2

Enable content-aware algorithms to attempt to crop the image to the desired aspect ratio while intelligently focusing on the most important visual content, including the detection of faces.

Trait implementations

impl Clone for CropMode

fn clone(&self) -> Self

Parameters

self: &Self

Returns

Self

impl Debug for CropMode

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Parameters

self: &Self
f: &mut $crate::fmt::Formatter

Returns

$crate::fmt::Result

Auto trait implementations

Blanket implementations