Remove an extraneous log message.
Ensure that a separate log message is only printed when the preceding
if-statement is true (and its string argument has actually been set).
Both issues were identified from GCC warnings about indentation.
abs() has an integer parameter and returns an integer value. Floating-
point values should be passed to fabs() instead.
In particular, this affected calculations for gain and offset, where a
value with floating-point precision is clearly expected.
The Product Revision Level field in the SCSI inquiry data has a fixed
length of 4 bytes. When copying it as a null-terminated string, place
the null terminator in the correct position; currently the string has
an extra character that is never initialized in memory.
Reduce the length of each string buffer, so it does not extend beyond
the null terminator.
If the weights file pathname is longer than PATH_MAX, it may be written
past the end of the buffer on the stack; or it may be truncated when it
is written to allocated memory (such that it is not null-terminated).
Adjust the code to fix both issues. Dynamically allocate memory for the
actual length of the pathname so that it is not constrained by PATH_MAX.
When using Automake variables like sanelib* to install files in a custom
directory, the files are assumed to be platform-independent, unless these
variables contain "exec" in the name. This affects whether the files are
installed during "make install-data" or "make install-exec". It does not
matter whether a suffix like _DATA or _LTLIBRARIES is added to this name.
The packaging scripts for Debian call those Makefile targets separately
and are affected by this behavior. Since the backend libraries themselves
are platform-dependent files, rename these variables to execsanelib*.
JPEG compression improves scan time, and some scanners require it
for high DPI values. But it loses some data, and we already support
toggling it at compile-time.
Add an advanced option so users can decide at scan-time.
Several files already don't have the exception that allows uses of the
code that are additional to the GPL license. I'm no longer comfortable
granting this exception for my subsequent contributions, thus the
exception has been removed.
This was used only on scanners which did not have calibration target
intensity value. All gl841 scanners now have such setting, so the code
can be removed.
True gray mode is not handled correctly by devices: they have bugs that
lead to incorrect LED color being emitted (e.g. dark red) and thus this
feature is completely unusable. At least LiDE 35/40/50, LiDE 60 and LiDE
80 are affected.
Simpy disabling true-gray unfortunately leads to even worse outcome
because the scanner then simply proceeds to perform a color scan.
To work around these problems we do a normal color scan and then produce
gray output based on the color data. This will satisfy the use cases
when correct gray is needed. In cases when it is sufficient to construct
gray from a single color channel, the color filter setting could be
used.
When sensor exposure values are significantly different from each other
the total scan exposure will be too low leading to the device becoming
confused and significantly
At least on LiDE 50 two-table feeding caused unexplained motor spin-up
failures on certain motor exposures. Various register modifications
showed that there's high likelihood on device-side bug. Even the
official drivers don't use proper two-table feeding.
This is not strictly necessary as all known C++ compilers also inject
these types to the global namespace. However this is not guaranteed by
the C++ standard and accordingly some code completion tools don't
support this without additional configuration.