Logic correction.

merge-requests/463/merge
Thierry HUCHARD 2020-05-10 01:28:49 +02:00
rodzic c1d302f3d7
commit 64c1c8a865
2 zmienionych plików z 16 dodań i 13 usunięć

Wyświetl plik

@ -1148,18 +1148,25 @@ sane_read(SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *len)
free(handler->scanner->img_data); free(handler->scanner->img_data);
handler->scanner->img_data = NULL; handler->scanner->img_data = NULL;
if (handler->scanner->source != PLATEN) { if (handler->scanner->source != PLATEN) {
SANE_Bool next_page = SANE_FALSE;
SANE_Status st = escl_status(handler->device, SANE_Status st = escl_status(handler->device,
handler->scanner->source); handler->scanner->source);
DBG(10, "eSCL : command returned status %s\n", sane_strstatus(st)); DBG(10, "eSCL : command returned status %s\n", sane_strstatus(st));
SANE_Bool next_page = // Thank's Alexander Pevzner (pzz@apevzner.com)
(SANE_STATUS_GOOD == st ? switch (status) {
SANE_TRUE : case SANE_STATUS_GOOD:
SANE_FALSE); case SANE_STATUS_UNSUPPORTED:
handler->scanner->work = next_page; case SANE_STATUS_DEVICE_BUSY:
handler->ps.last_frame = !next_page; DBG(10, "eSCL : next page\n");
if (handler->ps.last_frame == SANE_TRUE) next_page = SANE_TRUE;
default:
break;
}
handler->scanner->work = next_page;
handler->ps.last_frame = !next_page;
if (handler->ps.last_frame == SANE_TRUE)
status = SANE_STATUS_NO_DOCS; status = SANE_STATUS_NO_DOCS;
else else
status = SANE_STATUS_EOF; status = SANE_STATUS_EOF;
} }
else else

Wyświetl plik

@ -187,11 +187,7 @@ escl_status(const ESCL_Device *device, int source)
/* Decode Job status */ /* Decode Job status */
// Thank's Alexander Pevzner (pzz@apevzner.com) // Thank's Alexander Pevzner (pzz@apevzner.com)
print_xml_platen_and_adf_status(node, &platen, &adf); print_xml_platen_and_adf_status(node, &platen, &adf);
if (platen == SANE_STATUS_DEVICE_BUSY && if (platen != SANE_STATUS_GOOD &&
(adf == SANE_STATUS_NO_DOCS ||
adf == SANE_STATUS_GOOD)) {
status = SANE_STATUS_GOOD;
} else if (platen != SANE_STATUS_GOOD &&
platen != SANE_STATUS_UNSUPPORTED) { platen != SANE_STATUS_UNSUPPORTED) {
status = platen; status = platen;
} else if (source == PLATEN) { } else if (source == PLATEN) {