Crates.io | mag-image-decoder |
lib.rs | mag-image-decoder |
version | 0.1.0 |
source | src |
created_at | 2019-08-04 05:28:37.607865 |
updated_at | 2019-08-04 05:28:37.607865 |
description | MAG image decoder |
homepage | |
repository | https://bitbucket.org/yshryk/mag-image-decoder |
max_upload_size | |
id | 154072 |
size | 28,227 |
MAG format is also known as MAKI02, Maki-chan Graphics.
Cargo.toml:
[dependencies]
mag-image-decoder = "0.1"
main.rs:
use std::fs::File;
use std::io::BufReader;
use mag_image_decoder::Decoder;
let file = File::open("SAMPLE.MAG").expect("failed to open file");
let decoder = Decoder::new(BufReader::new(file)).expect("failed to decode header");
let header = decoder.info();
println!("{:?}", header);
let img = decoder.decode().expect("failed to decode image");
img.save("SAMPLE.png").expect("failed to save image");
% cargo build --release
% ./target/release/magdecode --help
% ./target/release/magdecode --outdir out *.MAG
% file out/SAMPLE.png
out/SAMPLE.png: PNG image data, 640 x 480, 8-bit/color RGB, non-interlaced
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.