From 1284f299b868bf36e76d44a9478595db87f2c487 Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Fri, 24 May 2024 10:11:00 +0900 Subject: [PATCH] use new_lossless(); lossy is not yet supported in WebPEncoder --- src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index f7e52ab..fcc1484 100644 --- a/src/main.rs +++ b/src/main.rs @@ -110,11 +110,10 @@ fn adjust_size_of_image( max_size: usize, ) -> Result> { let image = image::load_from_memory(&blob)?.into_rgba8(); - // try to re-encode the image to lossless WebP in any ways. blob = { let mut out = std::io::BufWriter::new(Vec::new()); - WebPEncoder::new_with_quality(&mut out, WebPQuality::lossless()).write_image( + WebPEncoder::new_lossless(&mut out).write_image( &image, image.width(), image.height(),