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.
- add new gray and color interlacing options for DR-C120
- initial support for DR-C120 and C130
- enable fine calibration for P-208 (per @sashacmc in !546)
The default values for string options are set using static (i.e.
non-malloced) strings. Later, if new values are loaded from the config
file, those SANE_Strings will then point to dynamically allocated memory
which is eventually leaked.
Change the initial values for the string options to NULL, and initialize
them to the proper values within sane_init() using strdup(). This way,
whenever the value for the string is changed, we can safely free() the
previous value.
This eliminates the other main source of memory leaks in the test backend.
This patch also updates sane_init for the test backend to properly cleanup
memory if it fails.
Inside Test_Device, track whether we've already called init_options().
If we have, don't call it again when calling sane_open() again.
Add a function cleanup_options() which frees the memory used for these
options, and call it in sane_exit() if we previously called
init_options().
Change Test_Devices to be initialized with calloc instead of malloc,
so that we can assume that uninitialized fields are NULL, and can safely
call free() on them unconditionally.
This eliminates some larger memory leaks within the test backend.
In the case where we are unable to get a path for loading libs, and
instead just use LIBDIR, we set 'src = strdup(LIBDIR)'. However, we
never update orig_src to point to src before tokenizing the path with
strsep(), so the memory is never freed.
Update load to always set orig_src to src so that we don't leak memory.
Some scanners (notably the Mustek 1248UB) doesn't like receiving a
STOP scan command when it is not scanning. Flag prevents it my making
sure that START/STOP commands are only ever paired up.
Calling this function upsets some scanners in this family.
This temporary sticking plaster permits the Mustek 1248UB scanner to
scan after cancelling. We need to look into this much more when a
scanner becomes available for investigation.
Enable autofocus support on my Epson 12000XL. The middle of the scan
area will be used as the focus point. An arbitrary X,Y is possible but
not implemented yet
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Allow the whole range of manual focus settings as an expert option. This
is also now independent of a TPU being installed or not. The old default
values are applied if the user changes the source type (either FLATBED
or TPU). Adding a focus group here because autofocus options will come
with later patches.
Signed-off-by: Wolfram Sang <wsa@kernel.org>
coolscan2 has focus entries already reused in coolscan3. Because I want
to add the same options to epson2, it makes sense to make them available
globally. Add i18n while here.
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Even with USB based scanners, we need to send the esci command to set
the focus. There is no byte in the extended scanning parameters for it.
So, move the code to a place where it is called for all cases.
Signed-off-by: Wolfram Sang <wsa@kernel.org>