When repos are forked on GitLab tags aren't copied (0 Tags) thus making
git-version-gen producing incorrect version ("UNKNOWN") which in turn
causes CI build failures (not helpful for people trying to make Merge
Requests). To workaround this issue reconstruct version from ChangeLogs
files (handy updated on every release). If git describe is not working
and we are not in dist package - take version from the top-most
ChangeLog file.
Example of error messages:
../libtool: line 1168: UNKNOWN + : syntax error: operand expected (error token is "+ ")
In file included from net.c:83:
net.c: In function 'connect_dev':
<command-line>: error: 'UNKNOWN' undeclared (first use in this function)
../include/sane/sane.h:31:21: note: in definition of macro 'SANE_VERSION_CODE'
31 | ( (((SANE_Word) (major) & 0xff) << 24) \
| ^~~~~
net.c:485:41: note: in expansion of macro 'V_MAJOR'
485 | req.version_code = SANE_VERSION_CODE (V_MAJOR, V_MINOR,
| ^~~~~~~
It's confirmed that neither Alpine nor Musl will fix ioctl warnings[1]
that making alpine build to fail and that these warnings are
harmless[2].
sanei_usb.c:4042:34: error: overflow in conversion from 'long unsigned int' to 'int' changes value from '3221771554' to '-1073195742' [-Werror=overflow]
4042 | if (ioctl (devices[dn].fd, SCANNER_IOCTL_CTRLMSG, &c) < 0)
| ^~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Link: https://gitlab.alpinelinux.org/alpine/aports/-/issues/7580
Link: https://www.openwall.com/lists/musl/2020/01/20/3
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.
jpeg_crop_scanline will adjust the x offset and the width of the image
to make it line up with the nearest iMCU boundary.
Before, this was not taken into account and it would make SANE
potentially allocate a too small buffer for the final image.
This would lead to segfaults because libjpeg would try to write outside
of the allocated memory region as it assumes that the buffer was
allocated with the new cinfo.output_width size after cropping.
Works OK, but, when scanning in automatic feeder mode, only the first page is scanned:
e.g. if run
SANE_DEBUG_XEROX_MFP=4 skanlite
skanlite thinks that scanning has been finished after the first page, but the scanner continues to work and debug messages about reading data from the scanner (sane_xerox_mfp_read: <..>) continue to be printed.
Signed-off-by: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>