auto-thumbnail 0.1.0

Converts various file formats into thumbnail image.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use image::DynamicImage;
use std::path::Path;

pub(crate) fn create_thumbnail<P>(path: P, width: u32, height: u32) -> anyhow::Result<DynamicImage>
where
    P: AsRef<Path>,
{
    let img = image::open(path)?;
    let resized = img.thumbnail(width, height);

    Ok(resized)
}