39 lines
1.4 KiB
Rust
39 lines
1.4 KiB
Rust
use std::io::Read;
|
|
|
|
fn main() {
|
|
let kra_path = "/mnt/extra/00_PROJECTS/hcie-rust-_images/kra_style_test/sultan.kra";
|
|
println!("Loading KRA from: {}", kra_path);
|
|
let file = std::fs::File::open(kra_path).unwrap();
|
|
let mut archive = zip::ZipArchive::new(file).unwrap();
|
|
let all_files: Vec<String> = archive.file_names().map(|n| n.to_string()).collect();
|
|
println!("Files inside KRA:");
|
|
for f in &all_files {
|
|
println!(" {}", f);
|
|
}
|
|
|
|
if let Some(asl_path) = all_files.iter().find(|n| n.ends_with("layerstyles.asl")) {
|
|
println!("Found layerstyles.asl at: {}", asl_path);
|
|
let mut asl_file = archive.by_name(asl_path).unwrap();
|
|
let mut asl_data = Vec::new();
|
|
asl_file.read_to_end(&mut asl_data).unwrap();
|
|
println!("ASL size: {} bytes", asl_data.len());
|
|
|
|
match hcie_fx::parse_asl_styles(&asl_data) {
|
|
Ok(parsed) => {
|
|
println!("Successfully parsed ASL styles. Found {} styles:", parsed.len());
|
|
for (uuid, effects) in parsed {
|
|
println!(" Style UUID: {}, Effects count: {}", uuid, effects.len());
|
|
for fx in effects {
|
|
println!(" Effect: {:?}", fx);
|
|
}
|
|
}
|
|
}
|
|
Err(e) => {
|
|
println!("Failed to parse ASL: {}", e);
|
|
}
|
|
}
|
|
} else {
|
|
println!("NO layerstyles.asl found!");
|
|
}
|
|
}
|