Crate zipimgzip

source ·
Expand description

Docs

Resize and ZipArchive the images in the Zip. (Zip -> Image -> ResizeImage -> Zip )

Example

Resize the images in the zip file to the specified size and compress them into a zip file

fn main() -> Result<(), std::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(());
}

MultiThread exmanple

fn main() -> Result<(), io::Error> {
let test_pixels: [u32; 2] = [750, 1334];
let test_quality: u8 = 90;
let test_path = String::from("C:\\test\\original.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)?;

Ok(())
}

Structs

Enums

Functions

Assign the images in the Zip file to MemoryImages. MemoryImages { pub input_memory_images: Vec, pub out_names: Vec, pub print_mode: PrintMode, }