docs: Documentation and minor changes

This commit is contained in:
2025-11-22 09:34:55 +01:00
parent 735d90fc01
commit 1293d014b1
3 changed files with 42 additions and 3 deletions

39
README.md Normal file
View File

@ -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.

View File

@ -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,
},

View File

@ -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)?;