Skip to main content

thumbnail_generate

Function thumbnail_generate 

Source
pub(in media) fn thumbnail_generate(
    image: &DynamicImage,
    requested: &Dim,
) -> Result<DynamicImage>
Expand description

Resizes a decoded picture to the requested dimensions.

Scaling preserves aspect ratio, while cropping fills the requested aspect ratio within the source bounds. Both methods avoid upscaling.