From 4728f2280613ec3b299de1c241d56cf16420f432 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Tue, 20 Apr 2021 00:58:03 +0100 Subject: [PATCH] Name crate correctly and add a simple test program --- agb-image-converter/Cargo.lock | 2 +- agb-image-converter/Cargo.toml | 2 +- agb-image-converter/src/bin/convert.rs | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 agb-image-converter/src/bin/convert.rs diff --git a/agb-image-converter/Cargo.lock b/agb-image-converter/Cargo.lock index ca3183df..e81e9ed8 100644 --- a/agb-image-converter/Cargo.lock +++ b/agb-image-converter/Cargo.lock @@ -15,7 +15,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[package]] -name = "agb-image-converter" +name = "agb_image_converter" version = "0.1.0" dependencies = [ "image", diff --git a/agb-image-converter/Cargo.toml b/agb-image-converter/Cargo.toml index 3635cf2d..2be58b95 100644 --- a/agb-image-converter/Cargo.toml +++ b/agb-image-converter/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "agb-image-converter" +name = "agb_image_converter" version = "0.1.0" authors = ["Gwilym Kuiper "] edition = "2018" diff --git a/agb-image-converter/src/bin/convert.rs b/agb-image-converter/src/bin/convert.rs new file mode 100644 index 00000000..0e7d3206 --- /dev/null +++ b/agb-image-converter/src/bin/convert.rs @@ -0,0 +1,15 @@ +use std::env; + +use agb_image_converter::{convert_image, ImageConverterConfig, TileSize}; + +fn main() -> () { + let args: Vec<_> = env::args().collect(); + + let file_path = &args[1]; + convert_image(&ImageConverterConfig { + transparent_colour: None, + tile_size: TileSize::Tile8, + input_image: file_path.into(), + output_file: "".into(), + }); +}