diff --git a/quickpeep_raker/src/raking.rs b/quickpeep_raker/src/raking.rs index da8910c..53070e5 100644 --- a/quickpeep_raker/src/raking.rs +++ b/quickpeep_raker/src/raking.rs @@ -5,7 +5,7 @@ use chrono::{DateTime, FixedOffset, Utc}; use cylon::Cylon; use futures_util::stream::StreamExt; use html5ever::tendril::fmt::Slice; -use image::ImageFormat; +use image::{GenericImageView, ImageFormat}; use itertools::Itertools; use lazy_static::lazy_static; use log::debug; @@ -507,7 +507,14 @@ pub fn rake_icon(content: &[u8], content_type: &str) -> anyhow::Result WANTED_DIMENSIONS { + image = image.thumbnail(WANTED_DIMENSIONS, WANTED_DIMENSIONS); + } let webp_encoder = webp::Encoder::from_image(&image).map_err(|err| anyhow!("webp fail: {}", err))?;