first version by zatzou
This commit is contained in:
commit
db62604054
5 changed files with 1048 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/target
|
1019
Cargo.lock
generated
Normal file
1019
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
8
Cargo.toml
Normal file
8
Cargo.toml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
[package]
|
||||||
|
name = "respack-decrypter"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
image = "0.25.5"
|
||||||
|
zune-png = "0.4.10"
|
BIN
inventory.png
Normal file
BIN
inventory.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
20
src/main.rs
Normal file
20
src/main.rs
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
use image::ImageBuffer;
|
||||||
|
use zune_png::{zune_core::options::DecoderOptions, PngDecoder};
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let data = include_bytes!("../inventory.png");
|
||||||
|
|
||||||
|
let mut decoder = PngDecoder::new_with_options(data, DecoderOptions::new_cmd());
|
||||||
|
|
||||||
|
decoder.decode_headers().unwrap();
|
||||||
|
let dim = decoder.get_dimensions().unwrap();
|
||||||
|
let col = decoder.get_colorspace().unwrap();
|
||||||
|
let data = decoder.decode_raw().unwrap();
|
||||||
|
|
||||||
|
// TODO: figure out propper color checks rn we assume data is RGBA
|
||||||
|
|
||||||
|
let out: ImageBuffer<image::Rgba<u8>, Vec<u8>> =
|
||||||
|
ImageBuffer::from_raw(dim.0 as u32, dim.1 as u32, data).unwrap();
|
||||||
|
|
||||||
|
out.save("out.png").unwrap();
|
||||||
|
}
|
Loading…
Reference in a new issue