From 11fa3660854a601475a5bb82d83c5152c87d5248 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 29 Jan 2025 20:48:46 +1300 Subject: [PATCH] Tweak eval cmp key for more consistent results --- src/evaluate.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/evaluate.rs b/src/evaluate.rs index b3801fac..dd60aee6 100644 --- a/src/evaluate.rs +++ b/src/evaluate.rs @@ -23,7 +23,7 @@ pub(crate) struct Candidate { pub idat_data: Vec, pub filtered: Vec, pub filter: RowFilter, - // first wins tie-breaker + // For determining tie-breaker nth: usize, } @@ -32,9 +32,9 @@ impl Candidate { ( self.idat_data.len() + self.image.key_chunks_size(), self.image.data.len(), - self.image.ihdr.bit_depth, self.filter, - self.nth, + // Prefer the later image added (e.g. baseline, which is always added last) + usize::MAX - self.nth, ) } }