#图像缩放 #zip存档 #图像压缩 #图像 #zip #缩放 #jpeg

bin+lib zipimgzip

调整 Zip 中的图像大小并压缩为 Zip 文件

8 个版本

0.3.1 2023 年 1 月 8 日
0.3.0 2022 年 11 月 4 日
0.2.2 2022 年 10 月 29 日
0.1.2 2022 年 10 月 25 日

709 in 图像

每月 22 次下载

MIT/Apache

34KB
786

zipimgzip

调整 Zip 文件中的图像大小并将其压缩为 Zip 文件。
(Zip -> Image -> ResizeImage -> Zip )

示例

将 zip 文件中的图像调整到指定大小并压缩成 zip 文件

 fn main() -> Result<(), io::Error> {
 let test_path = String::from("C:\\test\\original.zip");
 let test_outpath = String::from("C:\\test\\conv.zip");
 let test_pixels: [u32; 2] = [750, 1334];
 let test_quality: u8 = 90;

 let _ = unzip_to_memory(test_path, PrintMode::Print)?
 .convert_size(test_pixels[0], test_pixels[1], ConvMode::Height)?
 .create_zip(test_outpath, SaveFormat::Ref, test_quality)?;
 
 return Ok(());
 }

多线程示例

 fn main() -> Result<(), io::Error> {
 let test_pixels: [u32; 2] = [750, 1334];
 let test_quality: u8 = 90;
 let test_path = String::from("C:\\test\\test.zip");
 let test_outpath = String::from("C:\\test\\conv.zip");

 let _ = unzip_to_memory(test_path, PrintMode::Print)?
     .convert_size_multithread(test_pixels[0], test_pixels[1], ConvMode::Height)?
     .create_zip_multithread(test_outpath, SaveFormat::Ref, test_quality)?;

return Ok(())
}

支持

Jpeg/Jpg/Png

许可证

根据您的选择,许可协议为

贡献

除非您明确声明,否则您有意提交给作品作为包含在 Apache-2.0 许可证中定义的贡献,应按上述方式双重许可,不附加任何额外条款或条件。

依赖项

~21–31MB
~363K SLoC