41 lines
1.4 KiB
Rust
41 lines
1.4 KiB
Rust
use std::path::Path;
|
|
|
|
fn main() {
|
|
let path = Path::new("/home/hc/Pictures/_psd_stil_test/sultan.psd");
|
|
if !path.exists() {
|
|
println!("File not found: {}", path.display());
|
|
return;
|
|
}
|
|
|
|
let bytes = std::fs::read(path).unwrap();
|
|
|
|
// Direct parse (raw hcie_fx effects via psd::parse_psd_sequential)
|
|
let parsed = hcie_psd::psd_import::parse_psd_sequential(&bytes).unwrap();
|
|
println!("=== Direct parse (parse_psd_sequential) ===");
|
|
for (i, p) in parsed.iter().enumerate() {
|
|
println!("Parsed[{}]: name='{}' is_group={} effects={}", i, p.name, p.is_group, p.effects.len());
|
|
for fx in &p.effects {
|
|
println!(" {:?}", fx);
|
|
}
|
|
}
|
|
|
|
// Import via hcie_psd (protocol effects)
|
|
let layers = hcie_psd::import_psd(path).unwrap();
|
|
println!("\n=== Import via hcie_psd (protocol) ===");
|
|
for (i, layer) in layers.iter().enumerate() {
|
|
println!("Layer[{}]: name='{}' visible={} effects={}", i, layer.name, layer.visible, layer.effects.len());
|
|
for fx in &layer.effects {
|
|
println!(" {:?}", fx);
|
|
}
|
|
}
|
|
|
|
// Round-trip: protocol -> hcie_fx
|
|
println!("\n=== Round-trip conversion check ===");
|
|
for (i, layer) in layers.iter().enumerate() {
|
|
for (j, fx) in layer.effects.iter().enumerate() {
|
|
let round = hcie_fx::protocol_to_hcie_fx_effect(fx);
|
|
println!("Layer[{}] effect[{}] round-trip: {:?}", i, j, round);
|
|
}
|
|
}
|
|
}
|