From: Bastian Dehn Date: Fri, 23 Feb 2024 13:49:17 +0000 (+0100) Subject: change read only available image X-Git-Tag: v1.0.0^2~217 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=28854bb7b6611660c2fbdf9a4ff7e4a9831c6f74;p=sane-kds-s2000w-net.git change read only available image --- diff --git a/src/kds_s2000w_handler.c b/src/kds_s2000w_handler.c index 156a0a8..7b80fa9 100644 --- a/src/kds_s2000w_handler.c +++ b/src/kds_s2000w_handler.c @@ -288,11 +288,6 @@ void kds_s2000w_handler_get_parameters(void* handle) { debug_printf(ALL, "kds_s2000w_handler_get_parameters"); handler* h = (handler*) handle; - if (!h->current_scan_status->complete_scanned - && h->current_scan_status->available_images <= 0) { - _get_current_scan_status(h); - } - if (h->current_scan_status->complete_scanned && h->current_scan_status->available_images <= 0) { h->current_metadata->valid = 1; @@ -301,8 +296,15 @@ void kds_s2000w_handler_get_parameters(void* handle) return; } - _download_current_image(h); - _get_current_metadata(h); - _delete_current_image(h); - h->current_scan_status->current_image_number++; + if (!h->current_scan_status->complete_scanned + && h->current_scan_status->available_images <= 0) { + _get_current_scan_status(h); + } + + if (h->current_scan_status->available_images > 0) { + _download_current_image(h); + _get_current_metadata(h); + _delete_current_image(h); + h->current_scan_status->current_image_number++; + } } \ No newline at end of file