Blob Blame History Raw
From 88bfd55a66e59acef870e36554179746397a3f43 Mon Sep 17 00:00:00 2001
From: Benjamin Berg <bberg@redhat.com>
Date: Thu, 2 Jan 2020 18:43:16 +0100
Subject: [PATCH 164/181] examples: Save image even on match failure

Move the image saving out, so that it is always done when an image is
available. This allows viewing the image that corresponds to a match
failure.
---
 examples/verify.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/examples/verify.c b/examples/verify.c
index 1249dce..83d74ec 100644
--- a/examples/verify.c
+++ b/examples/verify.c
@@ -75,13 +75,13 @@ on_verify_completed (FpDevice *dev, GAsyncResult *res, void *user_data)
       return;
     }
 
+  if (print && fp_device_supports_capture (dev) &&
+      print_image_save (print, "verify.pgm"))
+    g_print ("Print image saved as verify.pgm\n");
+
   if (match)
     {
       g_print ("MATCH!\n");
-      if (fp_device_supports_capture (dev) &&
-          print_image_save (print, "verify.pgm"))
-        g_print ("Print image saved as verify.pgm");
-
       verify_data->ret_value = EXIT_SUCCESS;
     }
   else
-- 
2.24.1