Brightness and contrast adjustments are handled via gamma tables and
thus gamma functionality is required for these settings to have any
effect.
Previously if the device has a sensor with identity gamma
(gamma = {1, 1, 1}), then gamma tables were turned off, consequently
brightness and contrast settings had no effect.
The underlying issue was identified by Gunnar Hjalmarsson
<gunnarhj@ubuntu.com> and STK.
Initial support for Canon R40 SSM scanner with Letter-size ADF.
Hardware provides: gray/color, simplex/duplex, full-width, 300/600dpi
horizontal, with front mirrored horizontally.
This is separate commit because the previous commit introducing this
warning is completely unrelated and would not benefit from this change
being included.
Fixes:
genesys/utilities.h:229:23: error: invalid initialization of non-const reference of type 'std::basic_ios<char>&' from an rvalue of type '<brace-enclosed initializer list>'
stream_{stream}
^
genesys/image_pipeline.cpp:715:19: error: invalid initialization of non-const reference of type 'genesys::ImagePipelineNode&' from an rvalue of type '<brace-enclosed initializer list>'
source_{source}
^
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
This commit fixes a regression introduced in 1.0.25 for ADF scanners:
the scanning page-width was always set to a fixed value,
ignoring the page-width provided by the frontend.
This commit restores the behaviour that allows changing the page-width.
Signed-off-by: Peter Marschall <peter@adpm.de>
In the option descriptor definitions of tl_x, tl_y, br_x & br_y
make sure the the maximal value of the range is not smaller than
the minimal value.
Signed-off-by: Peter Marschall <peter@adpm.de>
Sent by Nakamura Iwao via sane-devel mailing list on Nov, 29th. I only
sorted the epson2 descriptions alphabetically.
Subject: [sane-devel] Additional model support for epson2 / epsonds backend
Message-ID: <TYCPR01MB7872CDD0461B7572D5DBD7A8EB669@TYCPR01MB7872.jpnprd01.prod.outlook.com>
Resolve "Canon LiDE 120: wrong size with -y -x after update to sane-backends 1.0.28-1078-g5747ffa9"
Closes#231
See merge request sane-project/backends!423
Fixes:
.../host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-uclibc/9.3.0/../../../../x86_64-buildroot-linux-uclibc/bin/ld: ./.libs/libpixma.a(libpixma_la-pixma_common.o): in function `sanei_pixma_read_image':
pixma_common.c:(.text+0xc05): undefined reference to `DBG'
.../host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-uclibc/9.3.0/../../../../x86_64-buildroot-linux-uclibc/bin/ld: pixma_common.c:(.text+0xc38): undefined reference to `DBG'
.../host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-uclibc/9.3.0/../../../../x86_64-buildroot-linux-uclibc/bin/ld: pixma_common.c:(.text+0xcbf): undefined reference to `DBG'
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Fixes:
sm3600-scanutil.c: In function ‘debug_printf’:
sm3600-scanutil.c:69:3: error: unknown type name ‘va_list’
69 | va_list ap;
| ^~~~~~~
sm3600-scanutil.c:48:1: note: ‘va_list’ is defined in header ‘<stdarg.h>’; did you forget to ‘#include <stdarg.h>’?
47 | #include "sm3600-scantool.h"
+++ |+#include <stdarg.h>
48 |
sm3600-scanutil.c:75:3: warning: implicit declaration of function ‘va_start’; did you mean ‘sane_start’? [-Wimplicit-function-declaration]
75 | va_start(ap,szFormat);
| ^~~~~~~~
| sane_start
sm3600-scanutil.c:76:28: warning: passing argument 3 of ‘vfprintf’ makes pointer from integer without a cast [-Wint-conversion]
76 | vfprintf(stderr,szFormat,ap);
| ^~
| |
| int
In file included from ../include/sane/sanei_config.h:50,
from sm3600.c:70:
.../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/stdio.h:339:23: note: expected ‘__va_list_tag *’ but argument is of type ‘int’
339 | __gnuc_va_list __arg);
| ~~~~~~~~~~~~~~~^~~~~
In file included from sm3600.c:94:
sm3600-scanutil.c:77:3: warning: implicit declaration of function ‘va_end’ [-Wimplicit-function-declaration]
77 | va_end(ap);
| ^~~~~~
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Fixes:
microtek.c: In function ‘MDBG_INIT’:
microtek.c:163:3: error: unknown type name ‘va_list’
163 | va_list ap;
| ^~~~~~~
microtek.c:78:1: note: ‘va_list’ is defined in header ‘<stdarg.h>’; did you forget to ‘#include <stdarg.h>’?
77 | #include "microtek.h"
+++ |+#include <stdarg.h>
78 |
microtek.c:164:3: warning: implicit declaration of function ‘va_start’; did you mean ‘sane_start’? [-Wimplicit-function-declaration]
164 | va_start(ap, format);
| ^~~~~~~~
| sane_start
microtek.c:165:54: warning: passing argument 4 of ‘vsnprintf’ makes pointer from integer without a cast [-Wint-conversion]
165 | vsnprintf(_mdebug_string, MAX_MDBG_LENGTH, format, ap);
| ^~
| |
| int
In file included from ../include/sane/sanei_config.h:50,
from microtek.c:70:
.../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/stdio.h:359:57: note: expected ‘__va_list_tag *’ but argument is of type ‘int’
359 | const char *__restrict __format, __gnuc_va_list __arg)
| ~~~~~~~~~~~~~~~^~~~~
microtek.c:166:3: warning: implicit declaration of function ‘va_end’ [-Wimplicit-function-declaration]
166 | va_end(ap);
| ^~~~~~
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
The config file argument needs to be freed when a device is not set.
That was missed for two occasions. The other occasion was freeing it
unconditionally leading to a use-after-free for the regular use case.
Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=980311
This is the least intrusive fix. The code really wants to be refactored.
Tested with a Mustek 1200 UB Plus.
Backends use a mixture of SANE_CURRENT_{MAJOR | MINOR} and V_{MAJOR |
MINOR} with all kind of permutations. I was confused by this and one
comment in pieusb.c tells me I was not alone. Some items in old
changelogs suggest to use the SANE_CURRENT_ macros in backends, so let's
switch to do that with the exception of net.c and dll.c. Done with:
$ find backend -name '*.[ch]' | xargs sed -i '/nearly every/ ! { s/\<V_M/SANE_CURRENT_M/g }'
$ git checkout backend/net.c backend/dll.c
And manually removing the comment from pieusb.c. Everything still builds
fine.
This patch is based on the file "epson2_fix.patch" from the archive
"SANE-patch-for-epsonds-epson2-20210518-5.zip" sent to the sane-devel
mailing list. The following changes have been made on top of the
original patch:
* in epson2.desc, the upstream entry for ET-2600 has been dropped
because a better version was provided in the new additions
* the seperate entry for XP-240 has been merged into the combined entry
for XP-243/245/247
* the new entries have been sorted into the existing entries
* original changes to epson2_usb.c have been dropped and were recreated
using the updated epson2.desc and epson2usb.pl
Use the output of the updated epson2usb helper. Affects only the
sorting, no functional change. Also, fix minor whitespace issues at the
end of the file.
Fixes:
genesys/scanner_interface_usb.cpp: In member function ‘virtual void genesys::ScannerInterfaceUsb::sleep_us(unsigned int)’:
genesys/scanner_interface_usb.cpp:484:10: error: ‘std::this_thread’ has not been declared
484 | std::this_thread::sleep_for(std::chrono::microseconds{microseconds});
| ^~~~~~~~~~~
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
The old epson driver disabled the focus by erasing the setFocus command.
The epson2 driver turned it into a seperate flag. However, scanners
which disabled focus in post_init were not converted to use the new
flag. Because we meanwhile set focus during init, these scanners could
not start anymore. Convert them to use the new flag.
While here, update the comment how we handle focus detection and update
the debug strings accordingly.
Bug reported by Hans Meir and debugged by Zdenek Dohnal. Many thanks!
- rewrite do_cmd() timeout handling
- remove long timeout TUR from v61 (did not help)
- allow config file to set initial tur timeout for DR-X10C (#142)
Define a new enum that contains Avision data type codes and use those instead
of pure values. I also added a couple of helper functions for debugging the
command operation and data type code if read or send.
With the exception of use in three quotes as well as our inlcuded copy
of the GPL, all use of the Free Software Foundation's postal address
has been removed.
Re #320.
297mm is advertised in the official specs for this machine family.
Tested against the ScanJet 3300C and it doesn't bottom out or anything.
Issue came about because A4 is 297mm in height and 296mm too short.
Probably just a typo or an oversight.