Wykres commitów

168 Commity (aa032f458d9bf6a30209ff8cca7d36c475f9a480)

Autor SHA1 Wiadomość Data
Christian Theis 1d502a288a set correct minimum dpi for AV_ASIC_C6 on avision 2022-05-08 15:08:16 +01:00
Ralph Little f85e2fb9c2 Resolve "Fix `mkstemp` error handling" 2022-05-01 22:02:55 +00:00
Ralph Little e0e9a614be Merge branch 'avision-fixes' into 'master'
avision: Fix issues found by code inspection

See merge request sane-project/backends!710
2022-04-24 17:08:20 +00:00
Ralph Little b217e7b002 avision: enhance return size checks to generate an appropriate error code.
Some of the status code checks also check that the returned data is
of the expected size. However, if they are not, it is possible to
return SANE_STATUS_GOOD in error. We should generate an appropriate
error code other than SANE_STATUS_GOOD for this case.
2022-04-24 09:49:51 -07:00
David Ward 8bbcdf8de3 avision: Invert conditional for software scaling
Place the alternative calls to fwrite() near each other in the code,
for better readability.
2022-03-27 16:51:30 -04:00
David Ward c7a33643f3 avision: Fix line numbers in debug message for software scaling
Print line numbers that are relative to the entire output, rather than
the current stripe.
2022-03-27 16:51:30 -04:00
David Ward 1277612c5b avision: Cancel scanning before closing device 2022-03-27 16:51:30 -04:00
David Ward bd6ad2e092 avision: Correctly handle failure to open file 2022-03-27 16:51:30 -04:00
David Ward f3162bafa8 Replace variable self-assignments to avoid Clang warnings
These were intended to suppress GCC warnings about unused variables.
However, this leads to different warnings from Clang instead.

Use another approach that suppresses warnings from both compilers.
2022-03-08 19:00:00 -05:00
David Ward 2955089cd9 Fix conditional expressions with unintended behavior 2022-03-08 19:00:00 -05:00
Paul Wolneykien b49deae017 avision: Added support for Avision FB2280E
It seems to be the same as FB2080E.

Signed-off-by: Paul Wolneykien <manowar@altlinux.org>
2021-12-16 12:43:26 +02:00
Wolfram Sang eb42ad08d5 treewide: use SANE_CURRENT_* macros consistently
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.
2021-06-08 19:01:41 +02:00
Giovanni Cappellotto 325c775036 Add function to debug avision command
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.
2021-02-21 19:53:46 -05:00
Olaf Meeuwissen e79adde8b2
Use URL to refer users to copies of the GPL and LGPL
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.
2021-02-12 17:41:38 +09:00
Ralph Little e111c48562 avision: added increment of the line variable in non-interpolated case 2020-12-19 17:28:36 -08:00
Ralph Little 15e200a981 avision: added some brackets to silence warnings about precedence ambiguity 2020-12-19 17:27:23 -08:00
Nikolai Kostrigin 5ef217b19d add ID information for Avision AV186+ and AV188 sheetfed USB scanners
backend/avision.c: add AV186+ as 'good',
                       AV188 as 'untested'
doc/descriptions/avision.desc: add AV186+ as 'good',
                                   AV188 as 'untested'
2020-09-28 18:31:56 +03:00
Olaf Meeuwissen cea2a83ea2 Merge branch 'master-spelling' into 'master'
spelling fixes

See merge request sane-project/backends!516
2020-09-07 09:24:15 +00:00
Peter Marschall 269a7c0413 spelling fixes for avision backend 2020-08-29 09:18:04 +02:00
Adam Richter f089aeac8c backend/avision.c adf_reset(): In debug message "adf_reset: read ... failed ...", fix arithmetic and compiler warning about printf integer format type mismatch. 2020-08-24 03:56:36 -07:00
Michael Niewöhner 743290300a backend/avision: fix lock-up of scanners not supporting fastfeed
de19ebc introduced a regression, where some scanners would lock-up
completely and require a full power cycle.

To fix that, do not call release_unit for any scanners not supporting
fastfeed for now, since that leads to lock-ups on at least one device.
Currently, it isn't clear what exactly is causing the problems, so it
maybe be enabled in a correct way again, later.

Resolves issue !337.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-08-10 19:46:52 +02:00
Michael Niewöhner e8ae2ca16f backend/avision: fix: use fabs instead of abs for double values
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:20:03 +02:00
Michael Niewöhner fa6dfcc44e backend/avision: i1120: finally set correct offsets for duplex
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:19:56 +02:00
Michael Niewöhner 7d7184a209 backend/avision: add missing offsets for bry
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:19:12 +02:00
Michael Niewöhner 6a6927b198 backend/avision: implement ADF first-sheet offset compensation
i1120 has another offset. When scanning in ADF multi-page mode (the
default), the very first sheet is moved 1.5mm down. That leads to 1.5mm
being cut off at the bottom.
This implements the (hopefully last) offset setting for multi-sheet ADF
scans.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:07 +02:00
Michael Niewöhner e96ce8887e backend/avision: add ADF front-only offset compensation
This adds offset compensation for ADF front-only scans, which may
have different offsets than ADF duplex scans.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:07 +02:00
Michael Niewöhner 58a3cdd042 backend/avision: Rewrite offset compensation
This is a complete rewrite of the offset compensation using a
combination of overscan and line skipping. It replaces the option
AV_REAR_OFFSET by specifying exact offset values for each scanner.
This was needed for Kodak i1120 which needs bottom line skipping.
The old implementation could not skip bottom lines since we could
not know how many lines we will get in the end from ADF.
The new implementation redirects the output file descriptor to a
temporary file. After the current page is completely scanned,
offsets are applied and the output is passed to the original
output file descriptor.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:07 +02:00
Michael Niewoehner b4716f6264 backend/avision: i1120: Add option AV_MULTI_SHEET_SCAN
Kodak i1120 has single-sheet and multi-sheet scan modes. This option sets
bitset3[7] which enables multi-sheet scan by default so there is no pause
of 1s between two sheets in ADF scan mode. This also fixes some offsets
when scanning multiple sheets.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner e54c9602e9 backend/avision: i1120: add option AV_GAMMA_UINT16
Kodak i1120 has a different gamma table format that looks like a
uint16/double array. Implement it and add an option for it.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner d8bf392424 backend/avision: i1120: add option AV_GAMMA_10
Kodak i1120 needs gamma to be set to 1.0 to give decent scan results.
Add an option for this.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner 886bf85d88 backend/avision: i1120: add option AV_NO_QCALIB_MODE
i1120 does not have an explicit "quality-calibration" mode. Add an
option to disable this mode.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner de19ebc61a backend/avision: i1120: add option AV_FASTFEED_ON_CANCEL
Some scanners like i1120 support fast feed-out of the sheet when
cancelling a running scan. Add a new option for this release type.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner 8b467b248e backend/avision: i1120: set AV_NO_REAR
Kodak broke rear-only scan (bitset3[3]) when they modified the Avision
firmware. It would be possible to add a work-around that drops front data and
writes rear data only. Because of deinterlacing, offsets etc. this is way too
complicated. The simpliest solution to scan rear-only is to turn around the
paper stack and use front scan instead.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner 692f87389b backend/avision: i1120: add option AV_OVERSCAN_OPTDPI
i1120 uses optical DPI for overscan calculation. Add an option for it.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner 74e94e6901 backend/avision: i1120: add option AV_NO_QSCAN_MODE
i1120 does not have an explicit quality-scan mode. Add an option to disable it.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner aff30cbb21 backend/avision: ability[3] seems to be a typo since ability[2] is dark cal indicator
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner de1a873cb7 backend/avision: i1120: use AV_SOFT_SCALE
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner c1c8ee8ea6 backend/avision: i1120: Enable gray filter to match windows driver
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner f393f8f246 backend/avision: i1120: add option AV_FORCE_CALIB
Add option AV_FORCE_CALIB to force calibration when scanner claims it is
not needed but it is.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner 196ce0b046 backend/avision: Add basic support for KODAK i1120
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Olaf Meeuwissen 090973fa94 Merge branch 'for-upstream/backend_avision_nonfilm_noexposure' into 'master'
backend/avision: Disable exposure option for non-filmscanners

See merge request sane-project/backends!23
2020-03-07 09:35:18 +00:00
Olaf Meeuwissen 960394b1e4 Merge branch 'for-upstream/backend_avision_fix_threading' into 'master'
backend/avision: fix thread cancellation

See merge request sane-project/backends!21
2020-03-07 09:25:59 +00:00
Rosen Penev c320a72e32
treewide: Replace mktemp by mkstemp
mktemp has been removed in POSIX 2008. uClibc-ng optionally does not make
it available.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-10-03 11:47:49 -07:00
Olaf Meeuwissen 296542905e avision: Fix threaded ADF flipping duplex handling. Re #24 2019-05-04 23:39:33 +09:00
Michael Niewoehner c16ff3ffe0 backend/avision: fix thread cancellation
sigprocmask does not work for threads but only for forked processes.
Even though a thread-safe version, pthread_sigmask, we do not use it
since using singals with threads is a bad practice. Instead implement
pthread's own cancellation method. Because sane_read blocks when
reader_process is terminated, read_fds is closed and invalidated to
make sane_read abort read and return gracefully.
2018-10-28 12:36:35 +01:00
Michael Niewoehner 6d2dda4a98 backend/avision: Disable exposure option for non-filmscanners 2018-09-29 21:21:18 +02:00
Olaf Meeuwissen df1aba21bc SANE_Pid: Fix [-Wint-conversion] issues
Not all pthreads implementations use an integer type for pthread_t.
As a matter of fact, POSIX has explicitly withdrawn the requirement
that it must be an arithmatic type.

The musl C library uses a `struct __pthread *` which triggered the
warnings.  As of this change, sanei_thread.h works around this by
providing two new macros to help keep this issue out of sight.  All
backends have been changed to use these macros.
2017-07-15 14:47:54 +09:00
Olaf Meeuwissen 398d5850fa avision: Fix [-Wunused-const-variable=] compiler warning
The const variable's definition has been #ifdef'd to prevent loss of
protocol info.
2017-06-26 11:08:03 +09:00
Olaf Meeuwissen 0f70ce9aac avision: Fix [-Wunused-const-variable=] compiler warning
The threshold option which used the abs_percentage_range was removed
in e2169ec4.
2017-06-26 11:05:01 +09:00
Olaf Meeuwissen 23891a2646 .editorconfig: trim trailing whitespace 2017-05-29 21:14:29 +09:00