From fb8cc9fce2bb79bdf48a182fddde5f818f7a98ea Mon Sep 17 00:00:00 2001 From: SirTalksalot75 <132705706+SirTalksalot75@users.noreply.github.com> Date: Sat, 17 Jun 2023 12:33:00 +0200 Subject: [PATCH] Added Dimension Compare Feature --- src/Feature/mod.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Feature/mod.rs b/src/Feature/mod.rs index de1615f..1e94545 100644 --- a/src/Feature/mod.rs +++ b/src/Feature/mod.rs @@ -92,12 +92,13 @@ fn average_luminance(image: Image) -> (String, FeatureResult) { (feature_name, feature_result) } +fn compare_Dim(image0: Image, image1: Image) -> (String, FeatureResult) { + let a = image0.width as f32 / image0.height as f32; + let b = image1.width as f32 / image1.height as f32; + let equal = a == b; -#[test] -fn test() { - let mut data = Database::default(); + let feature_name = String::from("Dimension-comparison"); + let feature_result = FeatureResult::Bool(equal); - data.add_feature(Box::new(average_luminance)); - - let _as_json = serde_json::to_string(&data); + (feature_name, feature_result) }