Without this change, pixma scanning is currently broken (tested with Canon MP495). The stated reason for the workaround (libusb not supporting timeouts for interrupts) hasn't been true since 2010:
67d9ef7b68
1. Fixed scan to jpeg/png
2. Fixed bottom part of the image
3. Removed white pixels from the right part of the image
4. Adjusted physical dimensions of the scanning area
Some xerox_mfp scanners, such as Samsung SCX-4521F, hangs when
their OUT ENDPOINT receives CLEAR HALT command, which is performed
in usb open and close functions of the backend.
The issue seem to be dependant on USB controller and assumingly
happens due to some sort of incompatibility of USB implementation
in the scanner.
Skip sending this command by default and add
SANE_XEROX_USB_HALT_WORKAROUND env variable to execute
CLEAR HALT commands.
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.
The acquisition with the xerox_mfp driver works almost out of the box
for the Samsung SCX-4521F but the process stops just before the end
of the document until an USB transfer timeout expires. The very last
part of the scanned document is missing then.
Do not request more data from the device than available for the last
USB transfer to overcome this problem and to be conform with the
properties of the vendor driver.
The driver was tested for all resolutions supported by the device
with color and grayscale mode.
No regression test with other devices supported by the xerox_mfp
driver was done because of lack of devices.