Files
OneCAD-Draft/examples/find_raster.rs
T
Hakan SevenandClaude Opus 4.7 03555ce8bd chore: expose lib target + open-path profiling examples
Examples can't import from a bin-only crate, so add a thin lib.rs that
re-exports the existing modules. Used by the new examples that helped
diagnose the freeze fixed in the previous commit.

- examples/time_open: times parse / purge / cache / first-wires phases
- examples/inspect_insert: lists Insert blocks with sub-entity counts
- examples/find_raster: dumps RasterImage path + dimensions

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-13 23:02:54 +03:00

15 lines
564 B
Rust

use acadrust::entities::EntityType;
use acadrust::io::dwg::DwgReader;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let path = std::env::args().nth(1).unwrap();
let doc = DwgReader::from_file(&path)?.read()?;
for e in doc.entities() {
if let EntityType::RasterImage(img) = e {
println!("file_path: {}", img.file_path);
println!("size: {} x {}", img.size.x, img.size.y);
if let Ok(meta) = std::fs::metadata(&img.file_path) { println!("disk size: {} bytes", meta.len()); }
}
}
Ok(())
}