imgk-app 0.0.2

Some wrappers for ImageMagick apps
Documentation
// License: see LICENSE file at root directory of `master` branch

use std::{
    io,
    path::PathBuf,
};

use imgk_app::{
    Format,
    convert,
};

#[test]
fn test_resizes() -> io::Result<()> {
    let img_file = PathBuf::from(file!()).parent().unwrap().join("640x400.png");
    let img_file_size = img_file.metadata()?.len();

    for f in vec![Format::PNG32, Format::PNG64, Format::JPG, Format::JPEG, Format::BMP, Format::GIF].into_iter() {
        let resized_size = convert::resize_to_bytes(&img_file, 10, 10, Some(f))?.len();
        assert_ne!(resized_size, 0);
        assert!(resized_size < img_file_size as usize);
    }

    Ok(())
}