forked from 1b-agent/opencadstudio-upstream
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 <noreply@anthropic.com>
15 lines
564 B
Rust
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(())
|
|
}
|