xerox_mfp: Fix lineart and halftone mode

Halftone and lineart mode do not work properly except for a
resolution of 600 dpi. The very last part of a scanned document is
missing and displayed as black stripe. This problem was found with a
Samsung SCX-4521F, but is assumed to affect other devices, too.

Decode the data received from the device in halftone and lineart mode
to fix this problem.

This patch was tested with a Samsung SCX-4521F device for all
resolutions supported by the device with color, grayscale, lineart
and halftone mode.
No regression test with other devices supported by the xerox_mfp
driver was done because of lack of devices.
merge-requests/569/head
Marc Schink 2017-01-15 18:59:17 +01:00 zatwierdzone przez ValdikSS
rodzic 7b0572a180
commit 3a58649ff1
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -1332,6 +1332,13 @@ sane_read(SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *lenp)
dev->total_out_size += *lenp;
return SANE_STATUS_GOOD;
}
} else if (dev->composition != MODE_RGB24) {
int diff = dev->total_img_size - dev->total_out_size;
int bufLen = (diff < maxlen) ? diff : maxlen;
if (diff > 0 && copy_plain_trim(dev, buf, bufLen, lenp) > 0) {
dev->total_out_size += *lenp;
return SANE_STATUS_GOOD;
}
}
/* and we don't need to acquire next block */