From b8fe879b22fca5622fbcd346bf3b0f336cd13064 Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Sun, 2 Jan 2022 18:58:54 +0300 Subject: [PATCH] In qoi-bench, report and skip invalid png files --- qoi-bench/src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qoi-bench/src/main.rs b/qoi-bench/src/main.rs index 3ca5643..57c0f7a 100644 --- a/qoi-bench/src/main.rs +++ b/qoi-bench/src/main.rs @@ -374,7 +374,12 @@ fn bench_png(filename: &Path, seconds: f64, use_median: bool) -> Result Result<()> { let mut totals = BenchTotals::new(); for file in files { - totals.update(&bench_png(file, seconds, use_median)?); + match bench_png(file, seconds, use_median) { + Ok(res) => totals.update(&res), + Err(err) => { + eprintln!("Error processing `{}`: {}", file.display(), err); + } + } } totals.report(use_median); Ok(())