diff --git a/README.md b/README.md new file mode 100644 index 0000000..6200bb5 --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# Papulastic image format + +Simple image format encoded/decoder and metadata extractor from file format from some random documentation from school. + +## How to use + +Just compile the binary 💀 + +```bash +cargo build --release +``` + +Or if you wanna be menace to society you can run `cargo run` everytime. + +## Encoding + +```bash +papulastic-image-format encode --input INPUT -o OUTPUT +``` + +You can also include initials and custom signature + +```bash +papulastic-image-format encode -i INPUT -o OUTPUT --initials JK --signature FALSE-BLINDNESS +``` + +## Decoding + +```bash +papulastic-image-format decode -i INPUT -o OUTPUT.png +``` + +## Metadata + +```bash +papulastic-image-format metadata -i INPUT +``` + +This code is not perfect but the documentation isn't too so I can't be bothered. diff --git a/src/cli.rs b/src/cli.rs index 7729f9a..79abf9e 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -21,7 +21,7 @@ pub enum Commands { #[arg(short='a', long, default_value = "UN")] initials: String, - #[arg(short='a', long, default_value = "TRUEVISION-XFILE")] + #[arg(short='s', long, default_value = "TRUEVISION-XFILE")] signature: String, }, diff --git a/src/encoder.rs b/src/encoder.rs index 1ad60de..fa9076a 100644 --- a/src/encoder.rs +++ b/src/encoder.rs @@ -7,8 +7,8 @@ use std::io::{BufWriter, Write}; use std::path::Path; pub fn encode(input: &Path, output: &Path, initials: &str, signature: &str, origin: u8) -> Result<()> { - if signature.len() > 15 { - return Err(GfxError::Format("Signature longer than 15 bytes!".into())); + if signature.len() > 16 { + return Err(GfxError::Format("Signature longer than 16 bytes!".into())); } let img = image::open(input)?;