Skip to content

Commit

Permalink
fix: 修复去水印后体积偏大的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lanyeeee committed Jul 26, 2024
1 parent c935753 commit 5250745
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src-tauri/src/watermark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 5250745

Please # to comment.