From 525074588006110063b5f5d44446675aceab6bc2 Mon Sep 17 00:00:00 2001 From: lanyeeee <1210347077@qq.com> Date: Fri, 26 Jul 2024 08:22:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8E=BB=E6=B0=B4?= =?UTF-8?q?=E5=8D=B0=E5=90=8E=E4=BD=93=E7=A7=AF=E5=81=8F=E5=A4=A7=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/watermark.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/watermark.rs b/src-tauri/src/watermark.rs index ea2ab57..ec3559b 100644 --- a/src-tauri/src/watermark.rs +++ b/src-tauri/src/watermark.rs @@ -352,7 +352,8 @@ fn save_jpg_image(img: &RgbImage, path: &Path) -> anyhow::Result<()> { std::fs::create_dir_all(parent).context(format!("创建目录 {} 失败", parent.display()))?; } // 保存去除水印后的图片,使用jpeg_encoder库的Encoder,效率更高 - let encoder = jpeg_encoder::Encoder::new_file(path, 97)?; + let encoder = jpeg_encoder::Encoder::new_file(path, 95)?; + // 如果要使用420的采样率 encoder.set_sampling_factor(jpeg_encoder::SamplingFactor::F_2_2); encoder .encode( img.as_raw(),