use image::imageops::FilterType;
use image::ImageFormat;
pub fn gif(width: u32, height: u32, destination: &std::path::PathBuf) -> std::path::PathBuf {
let destination_resize = destination.parent().unwrap().join(format!(
"{}-{}x{}.gif",
crate::commons::file_stem(destination.file_name().unwrap().to_str().unwrap()),
width,
height
));
let _resizing: image::DynamicImage = image::open(destination).unwrap();
_resizing
.resize_exact(width, height, FilterType::Nearest)
.save_with_format(&destination_resize, ImageFormat::Gif)
.unwrap();
destination_resize
}