]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change read only available image
authorBastian Dehn <hhaalo@arcor.de>
Fri, 23 Feb 2024 13:49:17 +0000 (14:49 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 23 Feb 2024 13:49:17 +0000 (14:49 +0100)
src/kds_s2000w_handler.c

index 156a0a8e6c1081bbe561854b209a9d7d5272c1c7..7b80fa96e363195efb1cf3b991c057a11b703585 100644 (file)
@@ -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