mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-02 06:17:22 -06:00
- gpu: the test modules share one GPU_LOCK, and timing and vector_mask take it too, so one process drives one wgpu device at a time. - ui-egui: the wgpu tests in pattern_preview_canvas, adjust_preview_gpu, marquee_autoscroll and layout_perf take gpu_lock(). - affinity compound_limits: the child process selects its test by the module path (compound_limits::<name>); with --exact, the bare name matches no test and the child passes without running the check. - xtask scorecard reads crates/io/tests/it/corpus.rs. - Docs and comments name the new test paths and the --test it filters.
38 lines
1.3 KiB
Rust
38 lines
1.3 KiB
Rust
//! Prints the raw metadata of files: `cargo run -p photocraft-raw --example inspect -- a.cr2 b.nef`
|
|
//! (handy while adding corpus files; the oracle expectations in `tests/it/raw_corpus.rs` come from it).
|
|
use std::env;
|
|
|
|
fn main() {
|
|
for path in env::args().skip(1) {
|
|
let bytes = match std::fs::read(&path) {
|
|
Ok(b) => b,
|
|
Err(e) => {
|
|
println!("{path}: read error {e}");
|
|
continue;
|
|
}
|
|
};
|
|
match photocraft_raw::decode(&bytes, &photocraft_raw::Limits::default()) {
|
|
Ok(s) => {
|
|
println!(
|
|
"{path}: {:?} make={:?} model={:?} {}x{} samples={} cfa={:?} wb={:?} black={:?} white={:?} crop={:?}..{:?} orientation={} warnings={}",
|
|
s.format,
|
|
s.make,
|
|
s.model,
|
|
s.width,
|
|
s.height,
|
|
s.samples,
|
|
s.cfa,
|
|
s.camera_wb,
|
|
s.black,
|
|
s.white,
|
|
s.active,
|
|
s.crop,
|
|
s.orientation,
|
|
s.warnings.len(),
|
|
);
|
|
}
|
|
Err(e) => println!("{path}: decode error {e}"),
|
|
}
|
|
}
|
|
}
|