diff options
Diffstat (limited to 'transcoder/src/image.rs')
-rw-r--r-- | transcoder/src/image.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/transcoder/src/image.rs b/transcoder/src/image.rs index 7ae2976..6da1be7 100644 --- a/transcoder/src/image.rs +++ b/transcoder/src/image.rs @@ -1,4 +1,5 @@ use anyhow::Context; +use image::{imageops::FilterType, ImageFormat}; use jellybase::{cache_file, AssetLocationExt}; use jellycommon::AssetLocation; use log::{debug, info}; @@ -26,7 +27,7 @@ pub fn transcode( // TODO shouldn't be neccessary with guessed format. let file = BufReader::new(File::open(&original_path).context("opening source")?); let mut reader = image::io::Reader::new(file); - reader.set_format(image::ImageFormat::Avif); + reader.set_format(ImageFormat::Avif); let reader = reader.with_guessed_format().context("guessing format")?; debug!("guessed format (or fallback): {:?}", reader.format()); let original = reader.decode().context("decoding image")?.to_rgba8(); @@ -34,7 +35,7 @@ pub fn transcode( &original, width as u32, width as u32 * original.height() / original.width(), - image::imageops::FilterType::Lanczos3, + FilterType::Lanczos3, ); let pixels = image.to_vec(); let encoded = ravif::Encoder::new() |