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 次下载
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 版 (LICENSE-APACHE 或 https://apache.ac.cn/licenses/LICENSE-2.0)
- MIT 许可证 (LICENSE-MIT 或 http://opensource.org/licenses/MIT)
。
贡献
除非您明确声明,否则您有意提交给作品作为包含在 Apache-2.0 许可证中定义的贡献,应按上述方式双重许可,不附加任何额外条款或条件。
依赖项
~21–31MB
~363K SLoC