From 1f96077e36cf7400dae85d24267ccc70424009b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 17 Jun 2020 14:00:19 +0200 Subject: [PATCH] examples: Don't try to save an image from a print without it A device may produce both prints with image data and not, so only do it in the case the prints contains image data --- examples/enroll.c | 2 +- examples/verify.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/enroll.c b/examples/enroll.c index ce6f755d..17c231f9 100644 --- a/examples/enroll.c +++ b/examples/enroll.c @@ -112,7 +112,7 @@ on_enroll_progress (FpDevice *device, return; } - if (fp_device_supports_capture (device) && + if (print && fp_print_get_image (print) && print_image_save (print, "enrolled.pgm")) printf ("Wrote scanned image to enrolled.pgm\n"); diff --git a/examples/verify.c b/examples/verify.c index 23bfe8c0..3b4c74d8 100644 --- a/examples/verify.c +++ b/examples/verify.c @@ -124,7 +124,7 @@ on_match_cb (FpDevice *dev, FpPrint *match, FpPrint *print, return; } - if (print && fp_device_supports_capture (dev) && + if (print && fp_print_get_image (print) && print_image_save (print, "verify.pgm")) g_print ("Print image saved as verify.pgm\n");