Porównaj commity

...

801 Commity

Autor SHA1 Wiadomość Data
ThierryFR b60e9f742e Merge branch 'escl-add-canon-ts5150' into 'master'
Add canon TS5150

See merge request sane-project/backends!842
2024-05-25 08:22:04 +00:00
Ordissimo 264c59ee8c Add canon TS5150 2024-05-25 10:14:06 +02:00
Ralph Little 70eff07edc Merge branch 'release-1.3.1' 2024-05-22 23:43:18 -07:00
Ralph Little 3ff55fd8ee create_release.sh: corrections to the script. 2024-05-22 22:34:40 -07:00
Ralph Little 55ab38e89b NEWS: updated 1.3.0 to 1.3.1 release because 1.3.0 was a failed release.
1.3.0 got out into the wild even though it didn't really work properly.
A few distros have expressed a desire for a 1.3.1 to replace it due
to reproducability reasons.
2024-05-22 22:05:39 -07:00
Ralph Little 4a5b17a08f Merge branch 'release-1.3.0' 2024-05-22 21:58:06 -07:00
Ralph Little 285730d569 create-release.sh: Added output of the curl JSON.
We can use the output of this to manually create the release if it
fails automatically. We needs the generated paths to provide to the
manual operation in the GitLab GUI.
2024-05-22 21:44:34 -07:00
ThierryFR 15eb96b7a0 Merge branch 'escl-adf-lineart' into 'master'
Escl adf lineart

See merge request sane-project/backends!840
2024-05-21 21:36:23 +00:00
ThierryFR fbf80b0fc1 Escl adf lineart 2024-05-21 21:36:23 +00:00
ThierryFR 7aa3d2de06 Merge branch '755-success-report-epson-expression-home-xp-4200-2022' into 'master'
eSCL Success report: Epson Expression Home XP-4200 (2022)"

Closes #755

See merge request sane-project/backends!839
2024-05-21 21:12:12 +00:00
ThierryFR 004b79c096 eSCL Success report: Epson Expression Home XP-4200 (2022)" 2024-05-21 21:12:12 +00:00
Ralph Little 0f472aa205 Merge branch 'editorconfig_inline_comment' into 'master'
.editorconfig: inline comments are forbidden

See merge request sane-project/backends!832
2024-04-19 19:53:22 +00:00
ThierryFR 728ca40272 Merge branch 'escl-force-idle-status' into 'master'
Escl force idle status

See merge request sane-project/backends!835
2024-04-16 20:45:49 +00:00
ThierryFR 113be50f6b Escl force idle status 2024-04-16 20:45:49 +00:00
Ralph Little bf99345ae2 Merge branch '8200i-1825-unsupported' into 'master'
Mark OpticFilm 8200i 0x07b3/0x1825 unsupported for now.

See merge request sane-project/backends!836
2024-04-02 22:51:47 +00:00
Cyp c918dba927 Mark OpticFilm 8200i 0x07b3/0x1825 unsupported for now.
Confusingly, there seem to be (at least) two different scanners with the same
name.
2024-04-02 19:57:01 +02:00
Cyp bc54b0990f Random minor cleanup. 2024-04-02 19:56:11 +02:00
ThierryFR 7ab85011fc Merge branch 'escl-add-model' into 'master'
escl add model.

See merge request sane-project/backends!833
2024-03-14 21:18:11 +00:00
Ordissimo 219dc45c16 escl add model. 2024-03-14 22:08:52 +01:00
Wolfram Sang 3e8cd75207 Merge branch 'document_fw_usage' into 'master'
add firmware names to description comments

See merge request sane-project/backends!830
2024-02-27 10:07:15 +00:00
Guillaume Girol a6d63a72ec .editorconfig: inline comments are forbidden
source: https://spec.editorconfig.org/#no-inline-comments

this makes neovim unhappy, at least.
2024-02-26 12:00:00 +00:00
Wolfram Sang 3d6acc98e0 artec_eplus48u: desc: add firmware names to comments
Make it easier for users to find the proper firmware by documenting it
in the comments section. I wrote a script to extract the data from the
driver and then manually verified/corrected it.

Signed-off-by: Wolfram Sang <wsa@kernel.org>
2024-02-15 20:12:20 +01:00
Wolfram Sang e183e24b2f epjitsu: desc: add firmware names to comments
Make it easier for users to find the proper firmware by documenting it
in the comments section. I wrote a script to extract the data from the
driver and then manually verified/corrected it.

Signed-off-by: Wolfram Sang <wsa@kernel.org>
2024-02-15 20:12:20 +01:00
Wolfram Sang c87c40a981 gt68xx: desc: add firmware names to comments
Make it easier for users to find the proper firmware by documenting it
in the comments section. I wrote a script to extract the data from the
driver and then manually verified/corrected it. Some model names needed
updates to match their entry in the sourcecode.

Signed-off-by: Wolfram Sang <wsa@kernel.org>
2024-02-15 20:12:01 +01:00
Ralph Little 7088afe04d NEWS: added release notes for 1.3.0 2024-02-12 19:44:29 -08:00
Ralph Little e1daaf076b Merge branch 'add_scsi_devices' into 'release-1.3.0'
sane-find-scanner: add additional SCSI devices for Linux platform.

See merge request sane-project/backends!829
2024-02-12 01:55:49 +00:00
Ralph Little 2f2394c20c sane-find-scanner: add additional SCSI devices for Linux platform.
This is a stop-gap for a Linux user. We will come up with a better
solution involving wildcards or regular expressions.
2024-02-11 17:26:54 -08:00
Wolfram Sang ee5f9a89e1 Merge branch 'epson2/ignore_cancel' into 'master'
epson2: ignore 'cancel request' status bit for more scanners

Closes #716

See merge request sane-project/backends!823
2024-02-04 19:07:33 +00:00
Alex Belkin 05c770546f Merge branch 'xerox_mfp-adf' into 'master'
xerox_mfp: When scanning from ADF, do not stop the device at page completion

Closes #537 and #47

See merge request sane-project/backends!655
2024-02-04 01:06:13 +00:00
Ralph Little 490aecbbac po: merge French translation to release 2024-01-31 19:51:12 -08:00
Ralph Little 61f6eae88d Merge branch 'release-1.3.0' into 'release-1.3.0'
Updated Simplified Chinese translation for SANE 1.3.0 release.

See merge request sane-project/backends!826
2024-02-01 03:37:59 +00:00
Ralph Little 99f3679b57 Merge branch 'french-translation' into 'master'
update french translation

See merge request sane-project/backends!825
2024-02-01 03:35:24 +00:00
ThierryFR 716e146ffc update french translation 2024-02-01 03:35:24 +00:00
Tyson Tan 10b414c7c5 Updated Simplified Chinese translation for SANE 1.3.0 release. 2024-02-01 03:30:40 +00:00
Ralph Little 37e4e6cabe po: merge Ukrainian translation to release. 2024-01-29 13:03:59 -08:00
Ralph Little 6b080c8c82 Merge branch 'uk_update3' into 'master'
Update Ukrainian translation

See merge request sane-project/backends!824
2024-01-29 20:34:04 +00:00
Yuri Chornoivan 6a57a9c308 Update Ukrainian translation 2024-01-29 22:21:11 +02:00
Ralph Little b761349240 doc: Rolf Bensch is no longer a maintainer for the pixma backend. 2024-01-29 10:23:32 -08:00
Ralph Little c98138f32e po: updated en_GB translation. 2024-01-29 10:20:47 -08:00
Ralph Little 0fe08c9036 po: updated all translations. 2024-01-29 10:13:50 -08:00
Wolfram Sang fc6516afc1 epson2: ignore 'cancel request' status bit for more scanners
Not only the Perfection1650, but other scanners need to ignore the
FSG_STATUS_CANCEL_REQ bit as well. Thanks to @matc for debugging and
providing a list. Should fix #716. Remove the hardcoded bitmask while
here.

Signed-off-by: Wolfram Sang <wsa@kernel.org>
2024-01-28 14:58:32 +01:00
Wolfram Sang f742d591fe epson2: desc: sync status of GT-6600U and Perfection 610
If the GT has "complete" support, Perfection 610 has also.

Signed-off-by: Wolfram Sang <wsa@kernel.org>
2024-01-27 23:19:09 +01:00
Ralph Little 242562d54e Merge branch '728-cannon-canoscan-lide-700f-is-working' into 'master'
Resolve "Cannon CanoScan LiDE 700F is working"

Closes #728

See merge request sane-project/backends!822
2024-01-26 18:21:47 +00:00
Ralph Little a08d5bbfac genesys: correct name of LiDE 700F. 2024-01-26 10:13:42 -08:00
Wolfram Sang 9266b647c5 Merge branch 'add-l360' into 'master'
Add support for epson L360

See merge request sane-project/backends!816
2024-01-26 14:23:06 +00:00
Artur Shepilko 86bb976ad6 xerox_mfp: When scanning from ADF, do not stop the device at page completion
- Stopping and releasing the device causes the ADF to purge any remaining pages,
thus only the first page gets properly scanned (observed with Samsung
SCX-4729FW).
- Instead, when sourcing from the ADF, at each page's completion it should
continue and issue "OBJECT POSITION" command to proceed to the next page.
- Once all pages have been processed, the subsequent "OBJECT POSITION" command
returns the proper "CHECK CONDITION" status  (ADF is empty) and triggers the
device stop and release.
- Additionally, the status of the ADF (loaded/empty) needs to be requeried
at the `sane_start()` for proper handling of the "Auto" mode. Otherwise,
the scanning session retains the ADF state from the start of the session,
even though ADF will become empty. Thus the "Auto" mode will not properly
switch to Flatbed as intended in the client application (observed in
Simple-Scan).

> NOTE: the initial "READ" command in `sane_start()` is extraneous and
> appears to always return STATUS_BUSY (indeed, the scanner is usually
> busy loading the page). The actual READ is correctly done in
> `dev_acquire()`. It may appear benign in a single page scan mode, however,
> it becomes malfunctioning in the mutipage ADF mode. The initial READ,
> when successful, will cause the skipping of the read block from processing,
> as the actual processing is tied to content read from `dev_acquire()`.
>
> Therefore, the initial READ command in the `sane_start()` is removed.
2024-01-25 17:20:03 -06:00
Artur Shepilko 8fe58ab678 xerox_mfp: Use doc source macros for clarity 2024-01-25 17:20:13 -06:00
Artur Shepilko 0a9bf84d3c xerox_mfp: Add support for Samsung SCX-4729FW (network mode) 2024-01-25 17:20:03 -06:00
Ralph Little 22108dca2a Merge tag '1.2.1'
Release 1.2.1
2024-01-17 15:54:42 -08:00
Ralph Little dcf4241470 Merge branch 'macfixes' into 'master'
Mac fixes

See merge request sane-project/backends!821
2024-01-12 05:36:52 +00:00
Ben Olden-Cooligan ec3eacfbcb Remove obsolete pixma macOS workaround
Without this change, pixma scanning is currently broken (tested with Canon MP495). The stated reason for the workaround (libusb not supporting timeouts for interrupts) hasn't been true since 2010:
67d9ef7b68
2024-01-11 20:21:36 -08:00
Ben Olden-Cooligan 3f217248f4 Always use pthreads for macOS
https://gitlab.com/sane-project/backends/-/issues/153
2024-01-11 20:20:47 -08:00
Ralph Little bff8d25007 Merge branch 'master' into 'master'
Fix hpljm1005 #723

See merge request sane-project/backends!819
2024-01-11 21:54:21 +00:00
ThierryFR 77059fe3d4 Merge branch 'escl_fix_option_without_poppler' into 'master'
escl: Fix option without poppler.

See merge request sane-project/backends!820
2024-01-11 18:23:04 +00:00
Ordissimo cc13a4986d escl: Fix option without poppler. 2024-01-11 19:13:45 +01:00
Tarwirdur Turon 829b11b72e Fix hpljm1005 #723
1. Fixed scan to jpeg/png
2. Fixed bottom part of the image
3. Removed white pixels from the right part of the image
4. Adjusted physical dimensions of the scanning area
2024-01-06 18:45:25 +03:00
Ralph Little aefcb71a23 Merge branch 'lexmark_X2670_backend' into 'master'
lexmark_x2600 add man mages & doc

See merge request sane-project/backends!818
2024-01-01 23:11:26 +00:00
Benoit JUIN 1c4058fb7c update authors and lexmark_x2600 desc 2024-01-01 05:04:00 +01:00
Ralph Little 22e3de3642 net: fix trailing whitespace from previous merge. 2023-12-31 18:46:24 -08:00
Ralph Little 268be2c712 Merge branch 'refactor_getlogin' into 'master'
Refactor deprecated getlogin()

See merge request sane-project/backends!817
2023-12-31 21:35:26 +00:00
Jonathan Schulz 8a57a6934f Refactor deprecated getlogin() 2023-12-31 21:35:26 +00:00
Benoit JUIN e7040a0b51 white space cleanup 2023-12-23 05:57:22 +01:00
Benoit JUIN f3c3dd0513 white space cleanup 2023-12-23 05:54:54 +01:00
Benoit JUIN 26d6390f92 ad man mages & doc 2023-12-23 05:49:47 +01:00
beeduh 4750093faa Add support for epson L360 2023-12-13 06:07:06 +00:00
Ralph Little 32f335d0f1 Merge branch 'master' into 'master'
Update DMC author's contact details

See merge request sane-project/backends!815
2023-12-12 16:57:46 +00:00
Dianne Skoll 3f612c1277 Update DMC author's contact details
My legal name and my email address have changed.
2023-12-11 22:15:30 -05:00
Ralph Little 8096f84a6f Merge branch 'lexmark_X2670_backend' into 'master'
Lexmark x2600 backend

See merge request sane-project/backends!769
2023-12-10 18:36:08 +00:00
Benoit JUIN c1e9a341ab memory leak fix 2023-12-03 08:08:07 +01:00
Benoit JUIN 7efa04ff78 white spaces 2023-12-03 07:12:11 +01:00
Benoit JUIN daebecd216 fix memory leak 2023-12-03 07:11:41 +01:00
Benoit JUIN 84c94b8368 handle usb plug/unplug correctly 2023-12-03 07:03:39 +01:00
Benoit JUIN 068714ef6e fix ifs 2023-12-03 06:14:03 +01:00
Benoit JUIN f7dd8e224d memoy leak fix 2023-12-03 06:00:23 +01:00
Benoit JUIN 7631c15c5e Mem alloc checks, typo and handle cancel scan correctly 2023-12-03 05:51:50 +01:00
Benoit JUIN 80478c865b add licence & author note 2023-11-30 06:47:40 +01:00
Benoit JUIN 0255c74669 free buffers 2023-11-30 04:53:35 +01:00
Ralph Little 65779d6b59 Merge branch 'libxml2-2.12' into 'master'
sanei_usb: Fix build with libxml2 2.12

See merge request sane-project/backends!814
2023-11-29 06:40:36 +00:00
Benoit JUIN ec9efba602 compile/typo fix 2023-11-29 06:39:17 +01:00
Benoit JUIN 0661fe9d89 fix warnings 2023-11-29 06:31:31 +01:00
Benoit JUIN 1fb0a78dd8 simple scan sends cancel on page finish ... 2023-11-29 06:23:32 +01:00
Benoit JUIN c9e8d812df reposition readPtr correctly 2023-11-29 06:10:05 +01:00
Jürg Billeter 3f727cfb8f sanei_usb: Fix build with libxml2 2.12 2023-11-28 21:35:01 +01:00
Benoit JUIN d022fa9c1b use buffers 2023-11-27 05:52:00 +01:00
Benoit JUIN 1513839238 whitespace cleanup 2023-11-26 06:43:53 +01:00
Benoit JUIN fc8e03ef69 cleanup logs 2023-11-26 06:08:37 +01:00
Benoit JUIN 6ee3558990 add color channel swap 2023-11-25 09:23:42 +01:00
Benoit JUIN 768fa3bf59 refactor more readable 2023-11-25 07:18:22 +01:00
Benoit JUIN 94b67794a5 handle high dpi and use a buffer to read data 2023-11-25 06:15:33 +01:00
Benoit JUIN 51aaef6d81 WIP: fill a buffer instead of messy sync read/write 2023-11-24 06:09:27 +01:00
Benoit JUIN 6e9f4b3785 fix debug line 2023-11-23 09:40:54 +01:00
Benoit JUIN 0a0afc2a71 fix typo 2023-11-23 09:13:29 +01:00
Benoit JUIN 5360166729 Merge remote-tracking branch 'origin/lexmark_X2670_backend' into lexmark_X2670_backend 2023-11-23 09:07:22 +01:00
Benoit JUIN 35aed3072c add debug info 2023-11-23 09:06:12 +01:00
Ralph Little 0098b1c58b Apply 2 suggestion(s) to 1 file(s) 2023-11-23 08:05:14 +00:00
Ralph Little 02f1a624f3 Apply 1 suggestion(s) to 1 file(s) 2023-11-23 08:03:57 +00:00
Ralph Little 15795b8071 Merge branch '715-have_libsnmp-redefinition' into 'master'
Resolve "HAVE_LIBSNMP redefinition"

Closes #715

See merge request sane-project/backends!812
2023-11-14 17:54:40 +00:00
Ralph Little bb8155804c configure.ac: Fixes to remove #define redefinitions from config.log
Involves a simple rearrange for some clauses to avoid #define
duplication in the config log.
2023-11-14 09:46:11 -08:00
Alex Belkin 0327a5c954 Merge branch 'fix-ci-no-tags' into 'master'
autogen.sh: Reconstruct version from ChangeLog files (for CI)

See merge request sane-project/backends!811
2023-11-08 20:30:00 +00:00
Alex Belkin 02a417721f autogen.sh: Reconstruct version from ChangeLog files (for CI)
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,
	|                                         ^~~~~~~
2023-11-07 23:34:24 +03:00
Ralph Little 5bf66ca4e5 Merge branch 'pixma_mf750' into 'master'
pixma: Added speculative definitions for MF750 imageclass machines.

See merge request sane-project/backends!810
2023-11-06 22:56:50 +00:00
Ralph Little 651fc3419a pixma: Added speculative definitions for MF750 imageclass machines.
Also corrected descrption file entry for TS8700.
2023-11-06 14:48:38 -08:00
Alex Belkin 2ba7215acf Merge branch 'fix-alpine-build' into 'master'
CI: Workaround build failures on Alpine

See merge request sane-project/backends!808
2023-11-06 22:00:14 +00:00
Alex Belkin 7a18846c60 CI: Workaround build failures on Alpine
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
2023-11-07 00:13:37 +03:00
Ralph Little 5b067b7cda Merge branch 'avision_warning_fix' into 'master'
avision: fix for warning related to pthread unused variable and shadowed variable name.

See merge request sane-project/backends!809
2023-11-06 18:37:43 +00:00
Ralph Little 43135ab7ed avision: fix for warning related to pthread unused variable and shadowed variable name. 2023-11-06 10:29:19 -08:00
Ralph Little 86f41b1360 Merge branch 'pixma-new-model-oct-2023' into 'master'
pixma: add models October 2023

See merge request sane-project/backends!807
2023-11-03 17:48:51 +00:00
Ordissimo 14dbdc759e pixma: add models October 2023 2023-11-03 10:15:17 +01:00
Alex Belkin b38e620c23 Merge branch 'xerox_mfp-no-usb-clear_halt-workaround' into 'master'
xerox_mfp: skip ENDPOINT CLEAR HALT command by default. #706

See merge request sane-project/backends!799
2023-11-03 04:19:53 +03:00
ValdikSS 655b9736c5 xerox_mfp: skip ENDPOINT CLEAR HALT command by default
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.
2023-11-02 15:55:55 +03:00
Ralph Little fd22c210cf Merge branch 'master' into 'master'
Correctly set O_NONBLOCK flag and disallow further reception using shutdown on...

See merge request sane-project/backends!803
2023-10-09 23:37:48 +00:00
ThierryFR edc0fd3283 Merge branch 'escl_work_without_zeroconf' into 'master'
Fix work with pre-configured device

Closes #711

See merge request sane-project/backends!804
2023-10-09 20:54:49 +00:00
ThierryFR d8c3848765 Fix work with pre-configured device 2023-10-09 20:54:48 +00:00
Tom Meyer-Mallorie 7df77203ad Correctly set O_NONBLOCK flag and disallow further reception using shutdown on saned data fd once a connection is open. 2023-10-07 22:51:00 +01:00
Ralph Little fd7b83c8f7 Merge branch '708-possible-segv-null-pointer-deref-in-sanei_configure_attach' into 'master'
Resolve "Possible SEGV (null pointer deref) in sanei_configure_attach()"

Closes #708

See merge request sane-project/backends!802
2023-10-02 23:47:59 +00:00
Ralph Little a92ffb3d97 Merge branch '709-possible-segv-heap-bounds-overwrite-in-init_options-test-c' into 'master'
Resolve "Possible SEGV (heap bounds overwrite) in init_options() (test.c)"

Closes #709

See merge request sane-project/backends!801
2023-10-02 23:41:27 +00:00
Ralph Little a617461c63 sanei_config: malformed line can return NULL for token. We should check. 2023-10-02 16:40:27 -07:00
Ralph Little 6fc47c4c14 test: added validation checks for config string option saelections.
This will avoid a reported buffer overflow issue related to invalid (long) options being specified.
2023-10-02 16:23:07 -07:00
Ralph Little ebb8152058 Merge branch 'epsonds_new_models' into 'master'
epsonds: New model support added.

See merge request sane-project/backends!800
2023-10-02 20:02:22 +00:00
Ralph Little 837d1622ea epsonds: New model support added. 2023-10-02 20:02:21 +00:00
Ralph Little 3c20a989cf Merge branch 'xerox-3335' into 'master'
xerox_mfp: add Xerox WorkCentre 3335

See merge request sane-project/backends!790
2023-09-27 14:01:16 +00:00
Ralph Little 41b865e2a5 Merge branch 'master' into 'master'
Correct tpo scan area for agfa arcus 1200

See merge request sane-project/backends!791
2023-09-27 13:58:52 +00:00
Ralph Little b510c87d85 Merge branch 'xerox_mfp-4521f-fixes' into 'master'
xerox_mfp: Add support for Samsung SCX-4521F. #707

See merge request sane-project/backends!797
2023-09-27 13:54:57 +00:00
Marc Schink 3a58649ff1 xerox_mfp: Fix lineart and halftone mode
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.
2023-09-27 16:32:45 +03:00
Marc Schink 7b0572a180 xerox_mfp: Fix various format specifiers 2023-09-27 16:30:16 +03:00
Marc Schink 1e1f8affb6 xerox_mfp: Add support for Samsung SCX-4521F
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.
2023-09-27 16:30:09 +03:00
Ralph Little 2fb8eb90cf Merge branch 'pixma-add-model' into 'master'
pixma:  add 2023 model

See merge request sane-project/backends!795
2023-09-26 15:32:00 +00:00
ThierryFR 3094f4a0dc Merge branch 'canon_pixma-add-model' into 'master'
canon_pixma :  add 2023 models

See merge request sane-project/backends!796
2023-09-26 04:34:45 +00:00
ThierryFR cd5443eec8 canon_pixma : add 2023 models 2023-09-26 04:34:44 +00:00
Ordissimo b1f6bea394 pixma: add 2023 models 2023-09-25 23:18:15 +02:00
Ordissimo 766162cad6 pixma: add 2023 models 2023-09-25 23:13:59 +02:00
ThierryFR 353e089ff4 Merge branch 'scanimage-pdf-error' into 'master'
Fix qpdfview error : Invalid XRef entry 0

See merge request sane-project/backends!794
2023-09-20 18:47:27 +00:00
Ordissimo 5978899b54 Fix qpdfview error : Invalid XRef entry 0 2023-09-20 08:58:49 +02:00
ThierryFR 0c1cbc1b6a Merge branch 'jpeg_fix' into 'master'
escl: Fix crash in libjpeg when cropping the scanned image

See merge request sane-project/backends!793
2023-09-19 19:41:43 +00:00
Sebastian Parborg ba7d24bf30 escl: Fix crash in libjpeg when cropping the scanned image
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.
2023-09-19 15:54:22 +02:00
ThierryFR 9bf2415fe6 Merge branch 'escl-fix-build' into 'master'
escl - Fix #690 use constant build .

See merge request sane-project/backends!792
2023-08-05 16:52:45 +00:00
Ordissimo f9951e3b31 escl - Fix constant build . 2023-08-05 17:55:14 +02:00
Antoni Simka caaf65f1a3
Correct tpo scan area for agfa arcus 1200 2023-07-28 18:21:50 +02:00
Mikhail Novosyolov ba3d80949d xerox_mfp: add Xerox WorkCentre 3335
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>
2023-07-03 19:20:00 +03:00
m. allan noah 9d721e4610 canon_dr backend v65
- fix imprinter support (#672)
- update attach_one and other init functions
2023-06-06 21:48:56 -04:00
Ralph Little 820ce39e94 Merge branch 'matkoniecz-master-patch-83655' into 'master'
apt install also requires sudo

See merge request sane-project/backends!789
2023-05-08 15:30:38 +00:00
Mateusz Konieczny cfb3ab1bbd apt install also requires sudo 2023-05-08 11:00:00 +00:00
Ordissimo b171aa7d87 Merge branch 'escl-fix-pwg-version' into 'master'
escl: Fix version of pwf:Version

Closes #675

See merge request sane-project/backends!788
2023-04-16 19:49:45 +00:00
Ordissimo aa3fc1cad8 escl: Fix version of pwf:Version 2023-04-16 19:49:45 +00:00
m. allan noah 90cc6b1fb7 fujitsu/ricoh.desc file updates
Sort model numbers to be more readable on our website.
Remove 'ricoh' from model names.
2023-03-28 08:29:02 -04:00
m. allan noah 44f96adb33 fujitsu.desc: remove trailing blank line 2023-03-27 21:03:39 -04:00
m. allan noah 9ce70f06c8 fujitsu backend v140
add initial support for Ricoh scanners
2023-03-27 20:59:03 -04:00
m. allan noah f4fcbb59f2 fujitsu.desc: add new line of Ricoh scanners
Fujitsu has transfered their line of scanners to Ricoh, initially
keeping the same USB VID and PID. So we duplicate all current
models into a Ricoh section.
2023-03-24 19:33:30 -04:00
Ralph Little 4f9300d1ae Merge branch 'epsonds-cleanups' into 'master'
epsonds: Add some missing entries

See merge request sane-project/backends!785
2023-03-17 05:11:38 +00:00
Benjamin Gordon c5c329ce24 epsonds: Give names to group options
The group options currently do not have names set.  Since only the title
is supposed to be valid for group options, this isn't a violation of
the SANE standard.  Regardless, it causes scanimage (and maybe other
frontends) to skip them.  Add empty name values so that they can be
processed properly.

Before:
Options specific to device `epsonds:net:n.n.n.n':
  Standard:
    --source Flatbed|ADF Front|ADF Duplex [Flatbed]
        Selects the scan source (such as a document-feeder).
    --mode Lineart|Gray|Color [Color]
        Selects the scan mode (e.g., lineart, monochrome, or color).
    --depth 1|8bit [8]
        Number of bits per sample, typical values are 1 for "line-art" and 8
        for multibit scans.
    --resolution 75|150|300|600|1200dpi [75]
        Sets the resolution of the scanned image.
    -l 0..215.9mm [0]
        Top-left x position of scan area.
    -t 0..297.18mm [0]
        Top-left y position of scan area.
    -x 0..215.9mm [215.9]
        Width of scan-area.
    -y 0..297.18mm [297.18]
        Height of scan-area.
    --eject [inactive]
        Eject the sheet in the ADF
    --load [inactive]
        Load a sheet in the ADF
    --adf-skew[=(yes|no)] [inactive]
        Enables ADF skew correction
    --adf-crp[=(yes|no)] [inactive]
        Enables ADF auto cropping

After:
Options specific to device `epsonds:net:n.n.n.n':
  Standard:
    --source Flatbed|ADF Front|ADF Duplex [Flatbed]
        Selects the scan source (such as a document-feeder).
    --mode Lineart|Gray|Color [Color]
        Selects the scan mode (e.g., lineart, monochrome, or color).
    --depth 1|8bit [8]
        Number of bits per sample, typical values are 1 for "line-art" and 8
        for multibit scans.
    --resolution 75|150|300|600|1200dpi [75]
        Sets the resolution of the scanned image.
  Geometry:
    -l 0..215.9mm [0]
        Top-left x position of scan area.
    -t 0..297.18mm [0]
        Top-left y position of scan area.
    -x 0..215.9mm [215.9]
        Width of scan-area.
    -y 0..297.18mm [297.18]
        Height of scan-area.
  Optional equipment:
    --eject [inactive]
        Eject the sheet in the ADF
    --load [inactive]
        Load a sheet in the ADF
    --adf-skew[=(yes|no)] [inactive]
        Enables ADF skew correction
    --adf-crp[=(yes|no)] [inactive]
        Enables ADF auto cropping
2023-03-13 10:57:18 -06:00
Benjamin Gordon 12ef54b087 epsonds: Allow querying OPT_ADF_CRP
The OPT_ADF_CRP (adf-crp) option is detectable from the hardware and is
settable as an option, but can't be queried.  This appears to just be an
oversight, so add it to the list of handled options.
2023-03-09 10:20:51 -07:00
Ralph Little 79962f324d Merge branch '664-pixma-backend-resets-mode-when-source-selected' into 'master'
Resolve "Pixma backend resets --mode when --source selected"

Closes #664

See merge request sane-project/backends!784
2023-03-08 06:22:58 +00:00
Ralph Little 59885e039e pixma: don't change resolution or mode when changing source
If currently selected resolution and mode are still valid when changing
source then retain the selected value rather than picking defaults.
2023-03-07 22:10:54 -08:00
Ralph Little 596f708c96 changelog: Add changelog missed from the 1.2.1 release 2023-02-27 20:04:50 -08:00
Ralph Little 3ab4342ce7 doc: remove "new" markers from lide70 and "template" backends. 2023-02-27 19:36:12 -08:00
Ralph Little 49943e7e45 Merge branch '570-issues-in-man-pages' into 'master'
Resolve "Issues in man pages"

See merge request sane-project/backends!692
2023-02-21 04:26:29 +00:00
Ralph Little 2b20ad5b12 doc: merge changes from default, related to removal of init system config. 2023-02-20 20:14:58 -08:00
Ralph Little 536e486ff7 Merge branch 'saned-doc' into 'master'
doc/saned: Improve service configuration details and security warnings

See merge request sane-project/backends!717
2023-02-21 04:00:50 +00:00
Ralph Little dd145a2383 Merge branch '410-sane-terminates-on-flatbed-scanning-xerox-3225-xerox_mfp-with-not-a-jpeg-file-starts-with-0x00' into 'master'
Resolve "sane terminates on flatbed-scanning (Xerox 3225, xerox_mfp) with : Not a JPEG file: starts with 0x00 0x00"

Closes #410

See merge request sane-project/backends!567
2023-02-21 00:48:34 +00:00
Ralph Little 5f99edda9f Resolve "sane terminates on flatbed-scanning (Xerox 3225, xerox_mfp) with : Not a JPEG file: starts with 0x00 0x00" 2023-02-21 00:48:34 +00:00
Ralph Little 06280f15c1 Merge branch 'master' into '570-issues-in-man-pages'
# Conflicts:
#   doc/sane-epjitsu.man
#   doc/sane-plustek_pp.man
2023-02-21 00:13:33 +00:00
Ralph Little e584a8c503 scanimage: fix for merge failure.
Two changes were made recently for the batch processing component
in scanimage. It's not too bad, just a couple of unused local vars.
Conflict was between some refactoring that I did and a change to
the processing for --batch-prompt.
2023-02-20 16:07:17 -08:00
Ralph Little 189c5361b7 Merge branch 'plustek7600i_8100_vidpid' into 'master'
genesys: Add VID:PID for Plustek OpticFilm 7600i and 8100

See merge request sane-project/backends!767
2023-02-20 23:54:45 +00:00
Ralph Little e147d111e3 Merge branch 'warmar-master-patch-05014' into 'master'
xerox_mfp: Add Dell 1135n

See merge request sane-project/backends!770
2023-02-20 23:52:42 +00:00
Warren Mar 9a190804dd xerox_mfp: Add Dell 1135n 2023-02-20 23:52:42 +00:00
Ralph Little 10b3345a1c Merge branch '16-low-default-buffer-size-results-in-poor-scanner-performance' into 'master'
Resolve "Low default buffer size results in poor scanner performance"

Closes #16

See merge request sane-project/backends!773
2023-02-20 23:51:26 +00:00
Ralph Little 30eb01674a saned: new header stdint.h required for SIZE_MAX. 2023-02-20 15:39:57 -08:00
Ralph Little 9d26edac5f sanei_wire: updated diag for size_t variables using %zu format
(u_long) casts sometimes generate incorrect values in diag.
%zu is pretty standard now so we should be using it for size_t args.
2023-02-20 15:25:46 -08:00
Ralph Little b5058ff5ed saned: increase default buffer size for backend comms to 1MB
Also added an option to change it.
2023-02-20 15:25:21 -08:00
Ralph Little 8ac72560ff Merge branch '646-scanimage-hangs-on-exit' into 'master'
Resolve "scanimage hangs on exit"

See merge request sane-project/backends!783
2023-02-20 20:31:18 +00:00
Ralph Little 1eff86953d Merge branch 'pixma-add-models' into 'master'
pixma: add new models

See merge request sane-project/backends!766
2023-02-20 17:24:49 +00:00
Ralph Little 1f22e0dadd avision: added ADF and lightbox installed options.
Also sorted out the options texts to make them translatable.
2023-02-19 15:08:59 -08:00
Ralph Little 9387e9b35c avision: match also USB vendor and product ids for USB devices.
We always know the USB vendor and product ids for USB devices and
there are multiple entries with the same SCSI details shared by
different USB models. We should pick the correct one at least to
get the right model name to the user.
2023-02-18 13:41:02 -08:00
Ralph Little d88920ffb6 avision: correction for ADF presence detect.
Scanjet 8300 has an ADF port but does not necessarily have an ADF
fitted. In the test case, there is a lightbox instead. Trying to
reset/probe for an ADF that isn't there is futile.
2023-02-18 13:02:29 -08:00
Ralph Little 2e5fffb036 Merge branch 'B-promptReturn' into 'master'
Scanimage Batch Prompt: Discard Extraneous Input Properly

See merge request sane-project/backends!781
2023-02-13 21:26:35 +00:00
Ralph Little 660547e33c Merge branch 'master' into 'B-promptReturn'
# Conflicts:
#   frontend/scanimage.c
2023-02-13 21:15:18 +00:00
Ralph Little bd9771939f Merge branch '634-llvm-15-on-freebsd-support-for-sane-backends-1-1-1_v2' into 'master'
Resolve "LLVM 15 on FreeBSD support for sane-backends 1.1.1"

Closes #634

See merge request sane-project/backends!782
2023-02-13 20:45:38 +00:00
Ralph Little 373dceaa36 scanimage: more generic fix for selecting a common basename function.
We have been specially including libgen.h to get a version in other
platforms such as macOS and FreeBSD. However, it is dangerous to
make assumptions about which version of basename that we will get.
So this change reverts to asking for the version that modifies the
argument and creates a copy of the arg that we *can* modify.
2023-02-13 12:32:35 -08:00
Matthew Gilmore 3222d342eb Less stack diddling 2023-02-10 04:13:13 +00:00
Matthew Gilmore 8072c2e895 batch-prompt - handle EOF and \n more accurately 2023-02-09 20:06:30 -08:00
Ralph Little 971a5a2e92 Merge branch 'master' into 'master'
po: add initial Georgian translation

See merge request sane-project/backends!780
2023-02-09 17:29:36 +00:00
NorwayFun 36d204e3fd po: add Georgian translation 2023-02-09 12:12:00 +00:00
NorwayFun b4ad09be99 Update LINGUAS: add Georgian 2023-02-09 12:11:10 +00:00
Ralph Little 53e227d171 Merge branch 'clang-16' into 'master'
acinclude.m4: fix -Wimplicit-function-declaration

See merge request sane-project/backends!763
2023-02-07 05:38:09 +00:00
Ralph Little 103c2b5d8e NEWS: release notes for 1.2.1 added. 2023-02-04 19:01:14 -08:00
Ralph Little b9fbe0b82e scanimage: handle backends that provide options with null attributes
HPAIO backend in some instances provides options that have NULL name.
It might be that it is using SETTABLE flag to disable options rather
than removing them from the options list. Or it might just be a
backend bug.
2023-02-04 16:16:54 -08:00
Ralph Little e3c1c0e000 doc: Updates to en_GB translations.
Not much to add, just confirming new messages.
2023-02-04 09:40:07 -08:00
Ralph Little 6b588b0d93 Merge branch 'uk_update2' into 'master'
Update Ukrainian translation

See merge request sane-project/backends!779
2023-02-01 17:19:56 +00:00
Yuri Chornoivan 6220b21429 Update Ukrainian translation 2023-02-01 18:53:17 +02:00
m. allan noah 573ca4b453 update canon_dr.desc for #552
Several canon scanners can operate as a mass storage device, holding
the windows software. They have a different USB PID in that case.
2023-01-27 18:09:57 -05:00
Ralph Little 7ee6327d3c Merge branch '634-llvm-15-on-freebsd-support-for-sane-backends-1-1-1' into 'master'
Resolve "LLVM 15 on FreeBSD support for sane-backends 1.1.1"

Closes #634

See merge request sane-project/backends!777
2023-01-07 07:48:17 +00:00
Ralph Little 370547fc60 scanimage, jpegtopdf: fixes for FreeBSD header definitions. 2023-01-06 23:36:43 -08:00
Ordissimo 4033ea23b6 Merge branch 'escl-add-espon-L3160' into 'master'
escl: add Epson EcoTank L3160 support.

Closes #632

See merge request sane-project/backends!776
2023-01-06 13:57:39 +00:00
Ordissimo 109a82f0fe escl: add Epson EcoTank L3160 support. 2023-01-06 14:42:11 +01:00
Ralph Little 7e85f737d0 Merge branch 'master' into 'master'
Update Russian translation

See merge request sane-project/backends!775
2022-12-28 18:11:42 +00:00
Mariya Shikunova e840ad7fa3 update translation 2022-12-28 08:50:11 +03:00
Ralph Little fea8ad2b99 Merge branch 'mg5700_buttons' into 'master'
pixma: MG5700 button-controlled scan

See merge request sane-project/backends!774
2022-12-21 17:37:30 +00:00
András Wacha 6352b00d6c
Made scan buttons work for Canon Pixma MG5700 2022-12-21 17:12:42 +01:00
Ralph Little f15a40c1bb scanimage: default buffer size increased to 1MB
Because -B argument was optional and specified 1MB if left out I have
made the argument mandatory now and updated the man page to match.
2022-12-04 10:00:47 -08:00
Ralph Little fc77717507 scanimage: some prep clean up work.
- reduce scope of some variables
- move full_optstring to global so that scanimage_exit can clean it up
- initialize global variables. Global statics are not initialized.
- some other more minor things
2022-12-04 09:29:02 -08:00
Ralph Little f9fe6d0ced Merge branch 'it-translation' into 'master'
Update 2 IT translations

See merge request sane-project/backends!772
2022-12-04 00:54:15 +00:00
Giovanni Cappellotto 506f539eda Update 2 IT translations
"Brightness" is "Luminosità", I'm 99.9% sure.

"Quality calibration" should be translated as "Calibrazione della
qualità" instead of "Qualità della calibrazione" because the subject is
"quality".
2022-12-03 16:23:38 -05:00
Ralph Little 15e1d83b9d Merge branch 'no_embedded_ldflags' into 'master'
sane-backends.pc.in: Don't embed LDFLAGS into libs.private

See merge request sane-project/backends!768
2022-11-30 18:19:16 +00:00
Zdenek Dohnal b3b44f1188 sane-backends.pc.in: Drop ldflags from the file
The ldflags variable is no longer used in the file because it embedded
LDFLAGS from build environment and LibGPhoto2 LDFLAGS, where the former
contains flags from the environment and can cause problems, and the
latter is empty.

With the state above, we can drop ldflags from pkgconfig file
completely.
2022-11-30 15:31:19 +01:00
Benoit Juin 1549f87198 handle cancel 2022-11-27 16:40:35 +01:00
Benoit Juin 2503ec8497 tweak options 2022-11-27 09:55:40 +01:00
Benoit Juin f8bd456aa5 remove useless edit 2022-11-26 22:23:28 +01:00
Benoit Juin 65c341b9d5 remove useless edit 2022-11-26 22:22:25 +01:00
Benoit Juin 6e488f3891 fix missing define 2022-11-26 22:20:26 +01:00
Benoit Juin d739ffb8f0 remove trailing whitepaces 2022-11-26 21:57:19 +01:00
Benoit Juin 185807a335 fix packet empty skip 2022-11-26 19:49:21 +01:00
Benoit Juin 0f9135def2 basic backend working 2022-11-26 15:05:49 +01:00
Benoit Juin eec401f5c3 data copy in progress 2022-11-26 08:45:57 +01:00
Benoit Juin 8efa358740 fix warnings 2022-11-26 08:16:54 +01:00
Benoit Juin 21f163e797 fix warnings 2022-11-26 08:15:11 +01:00
Benoit Juin 68d6519b6e fix packet forging 2022-11-26 07:43:23 +01:00
Benoit Juin e6cb0cf07e update packet forging 2022-11-26 07:14:45 +01:00
Benoit Juin a44127d1bc protocol implementation in progress 2022-11-26 06:36:57 +01:00
Benoit Juin d343dc963b protocol implementation in progress 2022-11-26 06:24:49 +01:00
Benoit Juin 315fe1fdf5 fix trailing whitespaces 2022-11-25 17:39:07 +01:00
Benoit Juin 51ba313173 backend in progress 2022-11-25 17:35:10 +01:00
Benoit Juin 175a8b0042 fix usb dependancies 2022-11-24 18:05:42 +01:00
Benoit Juin a9c3cfa4d7 fix usb dependancies 2022-11-24 18:01:04 +01:00
Benoit Juin ba3fd1dc4c remove new line 2022-11-24 17:36:37 +01:00
Benoit Juin 179257160b fix fedora build 2022-11-24 13:05:06 +01:00
Benoit Juin 8509c9dff4 trailing white space 2022-11-24 12:52:32 +01:00
Benoit Juin b19b324bf7 remove warnings 2022-11-24 12:49:58 +01:00
Benoit Juin ccfc476a07 Prepare backend build files 2022-11-24 12:08:29 +01:00
Zdenek Dohnal ef3e8b06ab genesys: Add VID:PID for Plustek OpticFilm 7600i and 8100 2022-11-22 10:57:24 +01:00
thierry1970 42d1143c0a pixma: add new models 2022-11-21 11:04:03 +01:00
m. allan noah ba1b68e6e9 canon_dr backend v64
- add complete support for imprinters on X10C (#585)

The vast majority of the work here was originally done in !706 by
Charles Quarra. I had some merge conflicts, and it was easier to
pull all his work into a patch and apply it myself.

The only changes I made were minor updates to comments, and adding
an imprinter group option. Sorry for the loss of attribution, and
thanks Charles!
2022-11-18 21:14:28 -05:00
m. allan noah bab852c5bb canon_dr backend v63
- minor tweaks to support for reading the total and roller counters
2022-11-18 19:23:10 -05:00
m. allan noah b9e11b1149 Merge branch 'canon-dr-x10c-counters' into 'master'
Adds support for total and roller counters

See merge request sane-project/backends!738
2022-11-18 23:40:02 +00:00
Charles Quarra 933b53608d Adds support for total and roller counters 2022-11-18 23:40:01 +00:00
m. allan noah 9144eada44 add fujitsu ScanSnap iX1400, fixes #555 2022-11-18 14:19:23 -05:00
m. allan noah 87e9be4be5 add ScanSnap iX1300 to fujitsu desc and conf 2022-11-17 21:24:45 -05:00
m. allan noah 190fa52619 epjitsu backend v33
- S1300i: fix color plane offset at 225 and 330 dpi (fixes #538)
2022-11-17 20:52:29 -05:00
m. allan noah 6acd5366cb epjitsu backend v32
- fix hanging scan when using source = ADF Back (fixes #601)
- minor improvements to .desc and manpage
2022-11-15 22:01:19 -05:00
m. allan noah eb52b43762 fujitsu documentation updates
- minor tweaks to text of manpage
- update the desc file status of some unsupported scanners
2022-11-15 19:36:53 -05:00
m. allan noah fa29906201 fujitsu backend v139
- move updated window_gamma logic to set_window
- use internal gamma table if possible (fixes #618)
2022-11-15 18:26:20 -05:00
m. allan noah 7547ee04e1 more fujitsu desc and conf for fi-8xxx 2022-11-09 23:34:19 -05:00
m. allan noah 642160ef97 fujitsu desc and conf updates
- add fi-81xx scanners
- clean up desc file comments
2022-11-09 20:44:14 -05:00
Sam James 300b460970
acinclude.m4: fix -Wimplicit-function-declaration
-Wimplicit-function-declaration will become an error by default
in Clang 16.

Fixes errors like:
```
error: call to undeclared library function 'exit' with type 'void (int) __attribute__((noreturn))'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
```

Signed-off-by: Sam James <sam@gentoo.org>
2022-11-04 04:04:46 +00:00
Ralph Little 436c507ade Merge branch '616-bug-in-current-release-libsane-for-ubuntu-22-04-1-with-samsung-scx-4828-fn' into 'master'
Resolve "BUG in current release libsane for Ubuntu 22.04.1 with Samsung SCX-4828 FN"

Closes #616

See merge request sane-project/backends!760
2022-10-22 01:44:52 +00:00
Ralph Little 388d75715f xerox_mfp: Added 4x28 to JPEG blacklist.
User reports the common JPEG problem with his Samsung SCX-4828 FN.
Machine announces itself as "Samsung SCX-4x28 Series"
2022-10-21 18:32:30 -07:00
Ralph Little b2a5a41be9 Merge branch 'ir1022a' into 'master'
pixma: add support for imageRUNNER 1018/1022/1023

See merge request sane-project/backends!759
2022-10-06 19:37:58 +00:00
Michał Kopeć 6740b47bca
pixma: add support for imageRUNNER 1018/1022/1023
Add support for Canon imageRUNNER 1018/1022/1023 models, which all share the
same USB PID. Add it as a copy of MF6500.

Tested with an iR1022A model. Flatbed and ADF both work correctly.

Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
2022-10-06 11:09:58 +02:00
Povilas Kanapickas 6b99447f5b Merge branch '597-failed-to-build-from-source-with-gcc-12' into 'master'
Resolve "Failed to build from source with GCC-12"

Closes #597

See merge request sane-project/backends!757
2022-10-04 05:29:20 +00:00
Pim van Tend 9afa6f6e74 Merge branch 'lide70_corrections' into 'master'
canon_lide70: Some small corrections.

See merge request sane-project/backends!758
2022-10-03 12:25:00 +00:00
Ralph Little ac11086cec canon_lide70: Some small corrections. 2022-10-02 18:27:45 -07:00
Ralph Little edfc90450e genesys: corrections to include file order.
minigtest.h has items that require the definitions in tests_printers.h.
Pre-GCC-12, this didn't seem to matter but GCC12 seems to have a
problem with this and requires the template definitions to have already
appeared.
2022-10-02 18:14:25 -07:00
Ralph Little 1da0970a7e Merge branch 'sane_canon_show_modelname' into 'master'
[canon] Use the common model name instead of string from the device

See merge request sane-project/backends!756
2022-09-21 17:23:46 +00:00
Zdenek Dohnal 0d7543ec65 backend/canon.c: Use the common model name instead internal string 2022-09-21 17:57:35 +02:00
Ralph Little b5e7e78312 Merge branch 'ambir_externals' into 'master'
doc_external: Added external driver entry for Ambir ImageScan Pro 820ix

See merge request sane-project/backends!755
2022-09-09 16:41:57 +00:00
Ralph Little e0c25d5a67 doc_external: Added external driver entry for Ambir ImageScan Pro 820ix
Also corrected a prior error in the Kyocera external file.
2022-09-09 09:29:54 -07:00
m. allan noah 4873304efe fujitsu.desc: Remove trailing whitespace 2022-09-06 21:18:31 -04:00
m. allan noah 8467535448 fujitsu backend 138
- update FCPA Inc to PFU America Inc
- note support for fi-7300NX (#594)
2022-09-06 20:22:55 -04:00
Ralph Little 693572d616 Merge branch 'desc_fix' into 'master'
sane-canon: update broken link in desc file.

See merge request sane-project/backends!752
2022-09-02 16:18:37 +00:00
Ralph Little 807d13de6d sane-canon: update broken link in desc file. 2022-09-02 09:06:55 -07:00
Ralph Little 9330bfdd83 Merge branch 'kyocera_external' into 'master'
doc: Added external report of Kyocera SANE driver.

See merge request sane-project/backends!749
2022-08-25 18:49:35 +00:00
Ralph Little 16eed3e526 doc: Added external report of Kyocera SANE driver. 2022-08-25 18:49:35 +00:00
Ralph Little 1d2253e21f Merge branch 'new_epsonds' into 'master'
epsonds: Added new model XP-2200 series.

See merge request sane-project/backends!748
2022-08-23 04:08:22 +00:00
Ralph Little cbffffbd7b epsonds: Added new model XP-2200 series.
Patch supplied by Nakamura Iwao from Epson Japan.
2022-08-22 20:55:59 -07:00
Povilas Kanapickas f1413cbc16 Merge branch 'pixma-adding-models' into 'master'
pixma: add 2 models

See merge request sane-project/backends!745
2022-08-16 17:28:50 +00:00
Ordissimo ba463b8966 Merge branch 'canon_pixma-adding-models' into 'master'
scangearmp2: add 2 models

See merge request sane-project/backends!746
2022-08-16 09:43:03 +00:00
thierry1970 32a86107cd scangearmp2: add 2 models 2022-08-16 11:31:59 +02:00
thierry1970 7ec4074fbd pixma: add 2 models 2022-08-16 11:20:02 +02:00
Ordissimo 8cd1488e3c Merge branch 'escl-fix-version' into 'master'
escl: get the eSCL version in the xml

See merge request sane-project/backends!744
2022-08-05 15:51:49 +00:00
thierry1970 23c7290931 Get the eSCL version in the xml 2022-08-05 17:40:20 +02:00
Ralph Little b51a2e9cf2 Merge branch 'pixma_support' into 'master'
pixma: user reports that their TS6420a (TS6400 family) works with USB

See merge request sane-project/backends!743
2022-07-24 17:41:16 +00:00
Ralph Little a417cb8edf pixma: user reports that their TS6420a (TS6400 family) works with USB 2022-07-24 10:28:51 -07:00
Ralph Little 97a0c90fd1 Merge branch 'umax_pp_tool_build' into 'master'
configure: corrected issue in Makefile.am and removed noinst build of umax_pp tool

See merge request sane-project/backends!741
2022-07-22 16:23:56 +00:00
Ralph Little c0e966b21e configure: corrected issue in Makefile.am and removed noinst build of umax_pp tool
Currently, there is no way to disable the build of the umax_pp low level
sources because the tool umax_pp is *always* built. Some platforms
cannot build the umax_pp low level code so this causes problems.
2022-07-22 09:10:46 -07:00
Ralph Little 409c23a745 Merge branch 'upstream_avision_AD345F_basic' into 'master'
avision: add AD345F support as "basic"

See merge request sane-project/backends!740
2022-07-15 04:09:23 +00:00
Nikolai Kostrigin 12f91442c0 avision: add AD345F support as "basic"
Tested with Avision AD345F model number DL-1802B.
Flatbed and ADF duplex scanning available.

Known limitation: ADF scanning is only capable to scan one sheet
at a time via automatic feeder. Providing 2+ sheets breaks backend
and scanner needs to be rebooted.

Signed-off-by: Nikolai Kostrigin <nickel@altlinux.org>
Tested-by: Mikhail Chernonog <snowmix@altlinux.org>
2022-07-11 14:28:03 +03:00
Ordissimo 948c1c5a40 Merge branch 'escl-fix-segfault' into 'master'
Escl: fix segfault

See merge request sane-project/backends!739
2022-07-05 06:36:44 +00:00
Ordissimo a698f003fe Escl: fix segfault 2022-07-05 06:36:44 +00:00
Ralph Little 3f45d4d19e test: fix type issue. proper type for usleep() is useconds_t. 2022-06-19 16:02:18 -07:00
Ralph Little 1e68bfc7fe Merge branch 'changelogs' into 'master'
ChangeLogs: Fix formatting issues, apply to 1.0.27 and 1.0.28, and add missing releases

See merge request sane-project/backends!736
2022-06-17 17:56:39 +00:00
Ralph Little adcbf249f9 avision: fix whitespace tool check problem 2022-06-01 20:48:55 -07:00
Ralph Little ba2c1f92f1 Merge branch 'test-high-res' into 'master'
Test backend - scanning high resolution images

See merge request sane-project/backends!737
2022-06-01 20:34:20 +00:00
Christian Theis 999a52f691 discussed amendments 2022-06-01 18:04:29 +01:00
Christian Theis 1aead16faf enable test backend to scan high res images 2022-05-29 20:52:51 +01:00
Christian Theis 39f9083deb compile avision with -Wconversion -Wtype-limits 2022-05-21 17:28:21 +01:00
David Ward 6ad2b593fe ChangeLogs: Reformat 1.0.27 and 1.0.28, and add missing releases
Apply formatting changes to the existing ChangeLogs for the 1.0.27 and
1.0.28 releases. (This includes re-ordering some entries so that merge
requests always appear together.) Manual formatting changes to entries
in these ChangeLogs have been preserved.

Add missing ChangeLogs for later releases.
2022-05-14 17:47:08 -04:00
David Ward 7ca518027b tools: Determine starting commit when generating a new ChangeLog file
This was still hard-coded to 1.0.28. Detect this automatically instead
by finding the most recent release tag.
2022-05-14 17:35:43 -04:00
David Ward 7467a9da22 tools: Use topological commit ordering when generating ChangeLog files
This means that commits from the same merge request will always appear
together in the ChangeLog, instead of appearing shuffled together with
other commits that were authored around the same time.
2022-05-14 17:35:43 -04:00
David Ward 4dbfa03ec4 tools: Fix inconsistent formatting when generating ChangeLog files
Use 12-digit short hashes (which appear in merge commits). The number
of digits required to unambiguously identify a commit increases as the
Git repository grows. The ChangeLog for the 1.0.27 release has 7-digit
short hashes, which are no longer meaningful: 9 digits are needed now.
Forcing 12 digits to display here is the solution in the Linux kernel.

Do not "decorate" the log with branch or tag names. It is understood
that each file starts at a specific release tag (e.g. 1.0.27) and ends
at the next tag (1.0.28), or at HEAD for development snapshots. Topic
branch names, or the refs "master" and "HEAD", do not need labeling.
2022-05-14 17:35:43 -04:00
Ralph Little 1d259c749a Merge branch 'ci-bump-versions' into 'master'
CI: Bump to Ubuntu 22.04 LTS and Fedora 36

See merge request sane-project/backends!735
2022-05-13 20:58:05 +00:00
David Ward 108716c840 CI: Bump to Ubuntu 22.04 LTS and Fedora 36 2022-05-12 21:51:28 -04:00
Ordissimo 8daae197a0 Merge branch 'escl-fix-version-xml-job' into 'master'
escl: fix version job.

See merge request sane-project/backends!734
2022-05-11 13:42:52 +00:00
thierry1970 df048b16f0 escl: fix version job. 2022-05-11 15:23:34 +02:00
Ordissimo 6b30245844 Merge branch 'escl-set-option-if-necessary' into 'master'
Escl: set option if necessary

See merge request sane-project/backends!733
2022-05-11 13:18:18 +00:00
Ordissimo 7431b65974 Escl: set option if necessary 2022-05-11 13:18:17 +00:00
Ordissimo 6acddfe7f0 Merge branch 'escl-normalize-spec' into 'master'
Escl: normalize spec

See merge request sane-project/backends!731
2022-05-11 09:59:20 +00:00
Ordissimo 024ae3b5fa Escl: normalize spec 2022-05-11 09:59:20 +00:00
Ordissimo f68b57378d Merge branch 'escl-delete-obselete-tag' into 'master'
escl : Remove obselete tag.

See merge request sane-project/backends!730
2022-05-11 06:59:40 +00:00
thierry1970 aa032f458d escl : Remove obselete tag. 2022-05-11 08:28:35 +02:00
Ralph Little f012ae84e5 Merge branch 'fix-scanjet-8250' into 'master'
set correct minimum dpi for AV_ASIC_C6 on avision

See merge request sane-project/backends!728
2022-05-08 17:41:51 +00:00
Christian Theis 1d502a288a set correct minimum dpi for AV_ASIC_C6 on avision 2022-05-08 15:08:16 +01:00
Ralph Little b8722a14ed Merge branch '149-fix-mkstemp-error-handling' into 'master'
Resolve "Fix `mkstemp` error handling"

Closes #149

See merge request sane-project/backends!725
2022-05-01 22:02:55 +00:00
Ralph Little f85e2fb9c2 Resolve "Fix `mkstemp` error handling" 2022-05-01 22:02:55 +00:00
Ralph Little a45e79bce6 Merge branch 'clang-warnings' into 'master'
Fix Clang warnings

See merge request sane-project/backends!727
2022-05-01 21:56:52 +00:00
David Ward a13cc4c1ff CI: Do not allow build job failures for Fedora 35
The CI build jobs targeting Fedora 35 pass (without compiler warnings).
Enforce this going forward.
2022-04-26 07:22:51 -04:00
David Ward 9e1819c3f7 configure: Use PKG_CHECK_MODULES to detect Net-SNMP
The output of "net-snmp-config --cflags" can contain optimization flags.
These might not be applicable to the current compiler, causing warnings.

Use PKG_CHECK_MODULES to check for Net-SNMP and obtain the compiler and
linker flags instead, in the same way as for libcurl or poppler-glib.
2022-04-26 02:12:25 -04:00
David Ward 4b15f35e75 mustek: Remove unused array variables
Introduce a CDB_SIZE() macro similar to that found in sanei/sanei_scsi.c.
This avoids warnings from Clang about unused variables.
2022-04-26 01:18:01 -04:00
Ralph Little e0aad8e814 Merge branch 'backend-built-sources' into 'master'
backend/Makefile: Fix handling of built sources

See merge request sane-project/backends!726
2022-04-25 14:17:15 +00:00
David Ward 76aa009316 backend/Makefile: Include dll-preload.h in sources 2022-04-24 23:13:26 -04:00
David Ward adac4f23e6 backend/Makefile: Improve rules for pixma/pixma_sane_options.{c,h}
Ensure these files are updated after pixma/pixma.c is changed. Do not
remove them during "make clean" or "make distclean", because they are
part of the source distribution (generated with "make dist"). Display
the relative paths in the build output.
2022-04-24 22:52:55 -04:00
David Ward 28b5aa7dee Revert "backend/Makefile: Remove unneeded references to $(srcdir)"
This breaks "make dist" when run locally in the CI container.
2022-04-24 21:03:32 -04:00
Ralph Little ac42d6e684 Merge branch 'sp30' into 'master'
Fujitsu / PFU SP30

See merge request sane-project/backends!716
2022-04-24 17:10:18 +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 5f27cc71c8 Merge branch '584-avision-reading-unexpected-length-is-not-handled-correctly' into 'master'
Resolve "avision: Reading unexpected length is not handled correctly"

Closes #584

See merge request sane-project/backends!724
2022-04-24 17:02:54 +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
Ralph Little dd822eda01 Merge branch 'thread-kvs40xx' into 'master'
kvs40xx: Return NULL from read_data()

See merge request sane-project/backends!722
2022-04-22 17:51:06 +00:00
Ralph Little 137a8f88c7 Merge branch 'poll-header' into 'master'
Fix header file used for poll()

See merge request sane-project/backends!723
2022-04-22 17:48:42 +00:00
David Ward 12560890a6 Fix header file used for poll()
POSIX specifies the header to include is <poll.h>, not <sys/poll.h>.
This results in a compiler warning with musl libc (on Alpine Linux).
2022-04-21 23:37:33 -04:00
Ralph Little 31cefeb659 Merge branch 'ci-debian-11' into 'master'
CI: Do not allow build job failures for Debian 11

See merge request sane-project/backends!721
2022-04-21 14:24:31 +00:00
David Ward 0286b132b7 CI: Do not allow build job failures for Debian 11
With the changes in commit a519a3529a,
the CI build jobs targeting Debian 11 pass (without compiler warnings).
Enforce this going forward.
2022-04-21 00:57:24 -04:00
Ralph Little 99dba99442 Merge branch 'lockpath-group-check' into 'master'
configure: Remove --with-group option for device locking

See merge request sane-project/backends!713
2022-04-21 04:52:28 +00:00
David Ward 944bb49e56 CI: Use Debian stable again to build docs and run "make distcheck"
This reverts commit b458cb14c6, now that
the CI build jobs targeting Debian 11 pass (without compiler warnings).
2022-04-21 00:48:22 -04:00
Ralph Little cc0d729e1f Merge branch 'pixma-add-TS3400' into 'master'
pixma:Add TS3400.

See merge request sane-project/backends!704
2022-04-21 04:40:26 +00:00
Ralph Little 71152f0171 Merge branch 'make-silent-rules-output' into 'master'
Utilize Automake macros for silent rules output

See merge request sane-project/backends!718
2022-04-21 01:23:44 +00:00
Ralph Little 33f0751670 Merge branch 'ci-bump-versions' into 'master'
CI: Bump all distributions to stable versions

See merge request sane-project/backends!705
2022-04-21 01:22:50 +00:00
Ralph Little f1e3a41037 Merge branch 'mustek-usb2-status' into 'master'
mustek_usb2: Replace STATUS type with SANE_Status

See merge request sane-project/backends!720
2022-04-21 01:22:09 +00:00
Ordissimo f71b32c632 Merge branch 'escl-pdf-mmap' into 'master'
escl: convert get_PDF_data() to use GMappedFile and GBytes

See merge request sane-project/backends!719
2022-04-19 12:11:24 +00:00
David Ward b2c2b74858 escl: convert get_PDF_data() to use GMappedFile and GBytes 2022-04-19 12:11:24 +00:00
David Ward 03bfd4232c Makefile: Utilize Automake macros for silent rules output
Building with --enable-silent-rules makes it easier to identify errors
or warnings in the build output. Automake provides macros for custom
rules to use, so that they will print a similar message to rules which
run the compiler or linker:

...
  CC       libpieusb_la-pieusb.lo
  CCLD     libpieusb.la
  CCLD     libsane-pieusb.la
  CC       libsane_pixma_la-pixma-s.lo
  GEN      pixma/pixma_sane_options.h
  GEN      pixma/pixma_sane_options.c
  CC       pixma/libpixma_la-pixma.lo
...

This does not change the current output if silent rules are disabled.
2022-04-17 20:16:19 -04:00
David Ward 939d62f836 backend/Makefile: Remove unneeded references to $(srcdir)
Adjust these rules to use relative pathnames, like the other rules.
2022-04-17 20:14:15 -04:00
Ralph Little 602b4f8d3d genesys: add full button support for the Canon 5600F
This model spreads their GPIO buttons lines over 3 different registers:
0x6c, 0xa6 and 0x6d
2022-04-15 11:50:56 -07:00
David Ward db25c1e7eb doc/saned: Improve security warnings
The current warnings do not explain to the administrator what risks may
actually be involved by exposing saned to the network, so that they can
take the appropriate measures.

Currently the administrator is advised to restrict incoming connections
to saned (using tcpwrappers and/or firewall rules). This might not have
been the typical posture when this was written. More importantly, these
actions are not meant to protect against a loss of confidentiality, and
the administrator should not be led to believe this is the case.

Suggest the use of a secure tunnel between each client and saned, which
can be achieved without modifying the software.
2022-04-14 19:45:56 -04:00
David Ward db009d158e doc/saned: Move service configuration details out of man page
The saned(8) man page should be used to describe the behavior of saned
itself. The information about configuring inetd, xinetd, or systemd to
launch saned - while it is helpful - belongs in a separate location.
Keep in mind that distribution packages usually configure the service
automatically, and they may ship with their own specific instructions.
(For example, update-inetd can be used in Debian and its derivatives.)

This change moves this information from the man page into a new file,
making it more concise as well. Working examples are moved to separate
files that can be copied directly from the source tree to the system.
2022-04-14 19:14:50 -04:00
Aaron Jackson a1fbbae636 Update fujitsu description to include SP30 as good 2022-04-14 22:25:29 +01:00
Aaron Jackson 140100bb23 Fujitsu / PFU SP30
Tested and working against the Fujitsu driver.
2022-04-14 22:13:20 +01:00
Ordissimo 785a935e9e Merge branch 'FixEsclTiffSupport' into 'master'
Fix inversed logic in escl_tiff.c:get_TIFF_data

See merge request sane-project/backends!715
2022-04-14 13:50:58 +00:00
Raphael Isemann 877871443d Fix inversed logic in escl_tiff.c:get_TIFF_data
malloc returns NULL on error, but this code errors out on the non-NULL pointer
indicating success (which essentially makes this function always fail).

Signed-off-by: Raphael Isemann <teemperor@gmail.com>
2022-04-14 08:29:43 +02:00
Ralph Little ea8d0eb91e Merge branch 'genesys_8400f_sensors' into 'master'
Genesys 8400f sensors

See merge request sane-project/backends!712
2022-04-13 18:24:57 +00:00
Ralph Little b3a04eae1a genesys: added special PDF function definitions for Canon 4400f 2022-04-13 11:07:45 -07:00
Ralph Little 54766358b5 genesys: corrections for 4400f buttons.
Additional special PDF buttons not yet included.
We need a strategy to deal with them.
2022-04-13 11:06:02 -07:00
Ordissimo 804e936a65 Merge branch 'escl-fix-type-ip' into 'master'
escl: Fix ipv6 detection.

See merge request sane-project/backends!714
2022-04-09 15:49:47 +00:00
Ordissimo b5d5b01886 escl: Fix ipv6 detection. 2022-04-09 17:31:36 +02:00
David Ward 172e161369 configure: Remove --with-group option for device locking
This option is not used anywhere in the code or the build system, except
that ./configure will not build device locking support if this is set to
a non-existent group. (It chooses uucp by default.)

However, that check does not actually work. It attempts to run the chgrp
command on a temporary file; but since ./configure is run without root
privileges, that always fails unless the user running ./configure is a
member of the group.

Remove both the option and the broken check. It is assumed that device
locking support was typically disabled in builds because of this issue,
and it will now be restored except where --disable-locking is specified.
2022-04-06 23:56:29 -04:00
Ralph Little ab7b3a38e2 genesys: added button definitions for Canoscan 8400F. 2022-04-03 14:47:51 -07:00
Ralph Little 586ff11af5 Merge branch 'pixma-sa-size' into 'master'
pixma: fix broadcast_sa size calculation

Closes #426

See merge request sane-project/backends!572
2022-03-29 05:45:03 +00:00
David Ward b458cb14c6 CI: Continue using Debian 10 to build docs and run "make distcheck"
While outstanding issues that cause compiler warnings are being fixed,
continue using Debian 10 (oldstable) rather than Debian 11 (stable) to
build HTML documentation and run "make distcheck".
2022-03-27 19:57:08 -04:00
Ralph Little 49dfefe8c0 Merge branch 'portable-filenames' into 'master'
Rename doc/*/template.desc. for Windows compatibility

See merge request sane-project/backends!711
2022-03-27 22:44:16 +00:00
David Ward 732fc8cad7 Rename doc/*/template.desc. for Windows compatibility
Windows does not allow filenames ending in a period ("."), preventing
this git repository from even being checked out on a Windows system.

Drop the trailing period in these two filenames. Both files will still
be skipped during the build, since they are not included in DESC_FILES
or DESC_EXT_FILES in doc/Makefile.am.
2022-03-27 17:11:56 -04: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
Ralph Little c1c77436f4 Merge branch '578-remove-linux-kernel-driver-for-plustek_pp-backend' into 'master'
Resolve "Remove Linux kernel driver for plustek_pp backend"

Closes #578

See merge request sane-project/backends!708
2022-03-25 03:49:57 +00:00
Ralph Little 3513af029e plustek-pp: Removed module build files from dist make rules. 2022-03-23 13:26:53 -07:00
Ralph Little 27a7c4518e plustek-pp: removed conditionally compiled code for Linux driver.
Mainly consists of removing code for #ifdef __KERNEL__
In order to keep it really clear what code has been removed, I have
not corrected any formatting issues.
2022-03-23 13:15:27 -07:00
Povilas Kanapickas e87bd848df Merge branch 'merge-release-1.1.x' into 'master'
Merge release-1.1.x branch to master.

See merge request sane-project/backends!709
2022-03-21 20:41:50 +00:00
Povilas Kanapickas aba8c30c92 Merge branch 'release-1.1.x' into merge-release-1.1.x 2022-03-21 22:26:33 +02:00
David Ward 60209994a1 CI: Temporarily allow build job failures
Specify -Werror in both CFLAGS and CXXFLAGS for all build jobs.

For the updated build targets, temporarily allow the build job to fail
while outstanding issues that cause compiler warnings are being fixed.
2022-03-19 19:10:40 -04:00
David Ward 6a14383e84 CI: Bump all distributions to stable versions
Use Alpine 3.15.0; Debian 10.11 and 11.2; Fedora 35; and Ubuntu 20.04.
2022-03-19 19:06:18 -04:00
Ralph Little 6054620c69 Merge branch '583-samsung-scx-4824fn-support' into 'master'
Resolve "Samsung SCX-4824FN Support"

Closes #583

See merge request sane-project/backends!707
2022-03-19 16:20:34 +00:00
Ralph Little ad08e768be Merge branch 'resolve-compiler-warnings' into 'master'
Resolve compiler warnings (including fixes for actual bugs)

See merge request sane-project/backends!701
2022-03-19 16:19:54 +00:00
Ralph Little 3635176eb9 plustek_pp: Removed references to the kernel driver from doc. 2022-03-15 18:57:51 -07:00
Ralph Little 2cf41870b9 xerox_mfp: added fix for Samsung SCX-4824FN and friends for broken JPEg support 2022-03-14 16:35:19 -07:00
Ralph Little 95e2498fe9 Merge branch 'canon_pp-weights-file' into 'master'
canon_pp: Avoid buffer overflow if pathname exceeds PATH_MAX

See merge request sane-project/backends!702
2022-03-14 00:25:02 +00:00
Ralph Little 7cdd2ad268 Merge branch '580-canoscan-lide-220-aborts-before-end-of-4800dpi-colour-scan' into 'master'
Resolve "Canoscan LiDE 220 aborts before end of 4800dpi colour scan"

Closes #580

See merge request sane-project/backends!697
2022-03-10 01:31:01 +00:00
Ralph Little 2d49a2af65 Merge branch 'pixma-fix-max-resolution' into 'master'
pixma:Fix max resolution

See merge request sane-project/backends!703
2022-03-10 01:29:59 +00:00
Ordissimo e5ff5d06e5 pixma:Fix max resolution 2022-03-10 01:29:59 +00:00
thierry1970 356f1c9b27 pixma:Add TS3400. 2022-03-09 09:02:41 +01:00
Ralph Little 84e907f87c Merge branch 'resolve-sane-desc-warnings' into 'master'
descriptions: Resolve multiple warnings from sane-desc

See merge request sane-project/backends!698
2022-03-09 03:51:08 +00:00
David Ward ff4114a795 kvs40xx: Return NULL from read_data()
Functions called by pthread_create() have the return type (void *).
However, the return statements in read_data() use a value of type
SANE_Status rather than a pointer, which causes a compiler warning.

This return value is never actually used, so return NULL instead.
2022-03-08 19:00:00 -05:00
David Ward 9cd0b1809c lexmark_low: Adjust calculation of bytes available in read buffer
GCC warns that an unsigned value is passed to abs(), which may not be
intended. To resolve this warning, adjust the code so abs() is not used
and the behavior is more explicit.
2022-03-08 19:00:00 -05:00
David Ward 0c70fd560c canon_pp: Avoid buffer overflow if pathname exceeds PATH_MAX
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.
2022-03-08 19:00:00 -05:00
David Ward 2efdd5a334 plustek: Adjust gain calculation to avoid calling labs()
labs() has a signed parameter. However the argument to it here was the
difference between two unsigned values, which itself remains unsigned.
GCC warned that using this in labs() might not have the intended result.

By definition though, dwInc >= m_dwIdealGain >= dwDec, so labs() is not
even needed in this expression.
2022-03-08 19:00:00 -05:00
David Ward 5576d03afd genesys: Fix forward declaration for type UsbDeviceEntry
This did not match the definition, causing a compiler warning.
2022-03-08 19:00:00 -05:00
David Ward 6048724f22 coolscan2, coolscan3: Fix initialization of enum members in struct
GCC warns when setting an enum member to 0 without an explicit cast.
Use the corresponding value in the enum type instead.
2022-03-08 19:00:00 -05:00
David Ward 47fd7538bc Remove set but unused variables which cause compiler warnings 2022-03-08 19:00:00 -05:00
David Ward a82a312d85 Remove unused functions which cause compiler warnings 2022-03-08 19:00:00 -05:00
David Ward 0d032cd982 Remove useless conditionals which cause compiler warnings
These always evaluate to true in the context of the surrounding code.
2022-03-08 19:00:00 -05:00
David Ward b3d105cba5 Use snprintf() instead of strncpy() for space-padded strings
The output from the SCSI inquiry command uses fixed-length space-padded
strings, which are copied into null-terminated strings before use.

This is currently done using strncpy(), with the count parameter set to
the string's fixed length. Because a null terminator is not encountered
in the input, strncpy() does not write one in the output, and GCC warns
about potential string truncation. A null terminator is added manually,
but this is error prone (as shown by the fix for the microtek backend).

Use snprintf() instead, which guarantees a null-terminated result and
resolves the warnings from GCC.
2022-03-08 19:00:00 -05:00
David Ward 6a16e78788 Use strdup()/strndup() instead of direct allocation and string copy
Otherwise, GCC warns about possible string truncation. This simplifies
the code here as well.
2022-03-08 19:00:00 -05:00
David Ward 3c3a247d25 Replace deprecated uint32 with uint32_t 2022-03-08 19:00:00 -05:00
David Ward db573b74ed Fix format specifiers to match arguments' data types 2022-03-08 19:00:00 -05:00
David Ward 1a933bba7e Cast pointer arguments if needed when using "%p" format specifier
Pointer arguments must have type (void *) when printed with the format
specifier "%p".
2022-03-08 19:00:00 -05: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 6be83f469b Resolve compiler warnings about misleading indentation
This change is targeted at specific lines of code reported by GCC or
Clang as potentially causing unintended behavior.
2022-03-08 19:00:00 -05:00
David Ward 6cc15e2b81 Adjust conditional expressions to resolve compiler warnings 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
David Ward 1458d23c42 umax: Fix unintended string concatenation in array definition
This causes the wrong error message to be used in the log.
2022-03-08 19:00:00 -05:00
David Ward bfa69c26e6 snapscan: Fix debug logging in sense_handler()
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.
2022-03-08 19:00:00 -05:00
David Ward 23addf5590 sm3840: Fix argument types for variadic function
Values of type unsigned char are automatically promoted to a larger
integer type, so they cannot be used as variadic function arguments.
2022-03-08 19:00:00 -05:00
David Ward 4cf3b09e49 rts8822, rts8891: Replace abs() with fabs() where needed
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.
2022-03-08 19:00:00 -05:00
David Ward e859ea4d89 pieusb: Add missing calls to sanei_pieusb_convert_status()
Fix cases where values of type PIEUSB_Status were used or returned when
the expected type was SANE_Status.
2022-03-08 19:00:00 -05:00
David Ward f8785fb6a8 mustek_pp: Handle status argument correctly in pa4s2_init()
Currently the pointer itself is overwritten, when it is intended that
the pointer be derefenced first.
2022-03-08 19:00:00 -05:00
David Ward f651d6f098 microtek: Fix null termination of string, and adjust buffer lengths
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.
2022-03-08 19:00:00 -05:00
Ordissimo 9cd8f475eb Merge branch 'escl-add-canon-ts-3400-series' into 'master'
escl: Add canon TS-3400 series

See merge request sane-project/backends!700
2022-03-08 08:59:43 +00:00
Ordissimo 84a39145e4 escl: Add canon TS-3400 series 2022-03-08 08:59:43 +00:00
David Ward a519a3529a mustek_usb2: Replace STATUS type with SANE_Status
In some cases, a return value with type SANE_Status was assigned to a
variable with type STATUS. It is easiest to remove the redundant type
here.
2022-03-02 21:16:47 -05:00
David Ward e1a319e729 descriptions: Resolve multiple warnings from sane-desc
Fix the USB VID/PID in device descriptions to use lowercase hex digits.
Remove an extraneous description, having no name or USB VID, from the
epsonds file. Remove an extraneous interface in the description for the
Brother MFC-J1300DW.

Additionally, fix mispellings of "Flatbed" and "WiFi".
2022-03-02 21:16:33 -05:00
Ralph Little 41866df6e1 genesys: fix for computation of total file size exceeding unsigned
Large scans that exceed 32-bits need cast to allow 64-bit size.
2022-02-27 18:55:26 -08:00
Ralph Little 4091619e07 Merge branch '577-add-plustek' into 'master'
Resolve "Issues making on osx"

Closes #577

See merge request sane-project/backends!696
2022-02-25 02:31:18 +00:00
Ralph Little 9512d05fe6 genesys: added conf entry for Plustek OpticFilm 7600i
User reports scanner works fine, but entry missing from config.
2022-02-22 16:22:23 -08:00
Ralph Little aa153e52c8 Merge branch '577-issues-making-on-osx' into 'master'
Resolve "Issues making on osx"

Closes #577

See merge request sane-project/backends!694
2022-02-22 17:37:48 +00:00
Ralph Little 047fa8498f Resolve "Issues making on osx" 2022-02-22 17:37:48 +00:00
Ralph Little f6594ed040 Merge branch '573-hp5590-read-only-values-aren-t-accessible-via-cli-options-unrecognized-option' into 'master'
Resolve "[hp5590] Read only values aren't accessible via CLI options (unrecognized option)"

Closes #573

See merge request sane-project/backends!693
2022-02-21 22:13:28 +00:00
Ralph Little a0ca5a4fc4 Resolve "[hp5590] Read only values aren't accessible via CLI options (unrecognized option)" 2022-02-21 22:13:28 +00:00
Ralph Little 0a3b043e8e doc: additional small changes to man pages. 2022-02-21 13:19:53 -08:00
Ralph Little d6419c2490 doc: cosmetic corrections to man pages from translator review 2022-02-20 18:23:59 -08:00
Ralph Little 312edd6d5f doc: Added Plustek OpticSlim 550 description, unsupported as yet 2022-02-19 14:25:13 -08:00
Ralph Little b701c499c9 Merge branch 'sane-find-scanner-output' into 'master'
sane-find-scanner: Improve output for possible USB scanners

Closes #575

See merge request sane-project/backends!691
2022-02-17 16:48:23 +00:00
David Ward 9daadb8512 sane-find-scanner: Improve output for possible USB scanners
Closes #575
2022-02-17 09:16:30 -05:00
Ralph Little 3c3e898c5e Merge branch 'fix-install-exec-target' into 'master'
backend/Makefile: Fix installation of backend libraries

See merge request sane-project/backends!690
2022-02-07 20:58:45 +00:00
David Ward ba07a8a7f5 backend/Makefile: Fix installation of backend libraries
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*.
2022-02-06 23:02:01 -05:00
Povilas Kanapickas b68172cbd2 Merge branch 'release-1.1.x-genesys-gl845-crash' into 'release-1.1.x'
[Release 1.1.x] genesys: GL845 has vector size 257 as well

See merge request sane-project/backends!689
2022-01-28 20:57:55 +00:00
Povilas Kanapickas e1f1273d23 Merge branch 'genesys_gl845_crash' into 'master'
genesys: GL845 has vector size 257 as well

See merge request sane-project/backends!688
2022-01-28 20:54:52 +00:00
Povilas Kanapickas 1a8a86bade genesys: Simplify gamma buffer setup
This also makes sure that we never access the source gamma tables out of
bounds which was possible previously.
2022-01-28 22:42:31 +02:00
Povilas Kanapickas fb41d3ca04 genesys: Simplify interface of generate_gamma_buffer() 2022-01-28 22:41:10 +02:00
Zdenek Dohnal aeb60735c1 genesys: GL845 has vector size 257 as well
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2042316
2022-01-28 22:39:56 +02:00
Povilas Kanapickas 2f17613dbb genesys: Simplify gamma buffer setup
This also makes sure that we never access the source gamma tables out of
bounds which was possible previously.
2022-01-28 22:39:26 +02:00
Povilas Kanapickas 188cf63627 genesys: Simplify interface of generate_gamma_buffer() 2022-01-28 22:39:26 +02:00
Zdenek Dohnal d8ebd5a4d7 genesys: GL845 has vector size 257 as well
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2042316
2022-01-28 22:31:09 +02:00
Povilas Kanapickas e3b5a9686f Merge branch 'release-notes-1.1.1' into 'master'
NEWS: Release notes for 1.1.1

See merge request sane-project/backends!687
2022-01-28 20:02:25 +00:00
Povilas Kanapickas c46f006209 NEWS: Release notes for 1.1.1
(cherry picked from commit a00a5f2f2c)
2022-01-20 00:08:17 +02:00
Povilas Kanapickas 332edc8b7c Release 1.1.1
Note that there is no 1.1.0 release as make distcheck was broken there.
The failure depended on the exact release number, thus it was not
noticed earlier.
2022-01-19 18:36:00 +02:00
Povilas Kanapickas 1c805281f2 NEWS: Update release version 2022-01-19 18:33:50 +02:00
Povilas Kanapickas 156337e5cd Merge branch 'fix-distcheck' into 'master'
testsuite: Allow any 1.x.y version when comparing sane-desc results

See merge request sane-project/backends!686
2022-01-19 15:47:01 +00:00
Povilas Kanapickas 2d75530344 Merge branch 'release-1.1.x-fix-distcheck' into 'release-1.1.x'
[Release 1.1.x] testsuite: Allow any 1.x.y version when comparing sane-desc results

See merge request sane-project/backends!685
2022-01-19 15:45:49 +00:00
Povilas Kanapickas 5529eb73d7 testsuite: Allow any 1.x.y version when comparing sane-desc results 2022-01-19 17:31:28 +02:00
Povilas Kanapickas c2a77be45b testsuite: Allow any 1.x.y version when comparing sane-desc results 2022-01-19 17:29:59 +02:00
Povilas Kanapickas 2cd4058942 Release 1.1.0 2022-01-18 23:04:46 +02:00
Povilas Kanapickas 44d0383458 Merge branch 'release-1.1.x-notes-1.1.0' into 'release-1.1.x'
[Release 1.1.x] Release notes for 1.1.0

See merge request sane-project/backends!684
2022-01-18 20:58:44 +00:00
Povilas Kanapickas a00a5f2f2c NEWS: Release notes for 1.1.0 2022-01-18 22:40:39 +02:00
Povilas Kanapickas b18fb290a9 Merge branch 'release-1.1.0-releasing-procedure' into 'release-1.1.x'
[Release 1.1.0] Update releasing procedure

See merge request sane-project/backends!683
2022-01-18 20:33:08 +00:00
Povilas Kanapickas b09575f6be Merge branch 'releasing-procedure' into 'master'
Update releasing procedure

See merge request sane-project/backends!682
2022-01-18 20:28:06 +00:00
Povilas Kanapickas bb0bee92f6 doc: Update the releasing documentation 2022-01-18 22:17:26 +02:00
Povilas Kanapickas 3738eb9e42 newsfragments: Document the misc news fragment type 2022-01-18 22:17:26 +02:00
Povilas Kanapickas 5f08348068 Setup release notes build using towncrier 2022-01-18 22:17:26 +02:00
Povilas Kanapickas 0ac693c2c7 doc: Update the releasing documentation 2022-01-18 22:12:19 +02:00
Povilas Kanapickas e3b847e981 newsfragments: Document the misc news fragment type 2022-01-18 22:12:18 +02:00
Povilas Kanapickas 3e1de72bcb Setup release notes build using towncrier 2022-01-18 22:12:17 +02:00
Povilas Kanapickas 3f955dd532 Merge branch 'make-jpeg-compression-optional' into 'master'
xerox_mfp: make JPEG compression user-configurable

See merge request sane-project/backends!615
2021-12-30 18:50:56 +00:00
Povilas Kanapickas 3f62c9132a Merge branch 'release-1.0.33-genesys-remove-gl847-unsupported-resolutions' into 'release-1.0.33'
[1.0.33] genesys: Remove unsupported resolutions on LiDE 100 and 200

See merge request sane-project/backends!681
2021-12-30 18:39:57 +00:00
Povilas Kanapickas 64bfc68a39 Merge branch 'genesys-remove-gpl-exception' into 'master'
genesys: Remove several accidental edits

See merge request sane-project/backends!680
2021-12-30 18:37:30 +00:00
Povilas Kanapickas 1a66f8c553 Add newsfragment 2021-12-30 20:35:03 +02:00
Andrew Sayers a336f5ed2f xerox_mfp: make JPEG compression user-configurable
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.
2021-12-30 20:34:05 +02:00
Povilas Kanapickas 5e463f4c91 Merge branch 'release-1.0.33-backport-genesys-remove-gpl-exception' into 'release-1.0.33'
[1.0.33] genesys: Remove exception for the GPL license

See merge request sane-project/backends!679
2021-12-30 18:28:12 +00:00
Povilas Kanapickas a3031367fe newsfragments: Add release note for MR !675
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/675

(cherry picked from commit 2f31fea9d3)
2021-12-30 20:24:34 +02:00
Povilas Kanapickas 773f0e5061 genesys: Remove unsupported 75 and 100 dpi resolutions on LiDE 200
(cherry picked from commit eca148dbf4)
2021-12-30 20:24:34 +02:00
Povilas Kanapickas fe6fe45098 genesys: Remove unsupported 75 and 100 dpi resolutions on LiDE 100
(cherry picked from commit c86564a3e3)
2021-12-30 20:24:34 +02:00
Povilas Kanapickas 0dc467a334 genesys: Log the target motor speed in case it can't be acquired
(cherry picked from commit f5d5928346)
2021-12-30 20:24:34 +02:00
Povilas Kanapickas cf7dde3c4b genesys: Remove several accidental edits
Fixes 59506f866d.
2021-12-30 20:21:31 +02:00
Povilas Kanapickas a45a29d948 Merge branch 'release-1.0.33-backports' into 'release-1.0.33'
[1.0.33] Backport release notes

See merge request sane-project/backends!678
2021-12-30 18:21:01 +00:00
Povilas Kanapickas e0425c737d genesys: Remove exception for the GPL license
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.

(cherry picked from commit 59506f866d)
2021-12-30 20:13:14 +02:00
Povilas Kanapickas 2b6fa1056d newsfragments: Add release note for MR !673
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/673

(cherry picked from commit 9887b162d9)
2021-12-30 20:05:22 +02:00
Povilas Kanapickas ef45427c53 newsfragments: Add release note for MR !622
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/622

(cherry picked from commit fec5e8917f)
2021-12-30 20:05:21 +02:00
Povilas Kanapickas 4a2ebc7fee newsfragments: Add release note for MR !659
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/659

(cherry picked from commit cb6a7d0a90)
2021-12-30 20:05:20 +02:00
Povilas Kanapickas d1690a044d newsfragments: Add release note for MR !669
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/669

(cherry picked from commit 77baf258b6)
2021-12-30 20:05:19 +02:00
Povilas Kanapickas 78c188542a newsfragments: Add release note for MR !667
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/667

(cherry picked from commit 3b91ab76e6)
2021-12-30 20:05:18 +02:00
Povilas Kanapickas 9864172a11 newsfragments: Add release note for MR !621
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/621

(cherry picked from commit 8f0e1d2b483ee83b8675f62ae19f0eea631e2a57)
2021-12-30 20:05:17 +02:00
Povilas Kanapickas c13555df6f newsfragments: Add release note for MR !620
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/620

(cherry picked from commit 37603742d52c8b3226ec7f4fb54cb2362ff0f68c)
2021-12-30 20:05:16 +02:00
Povilas Kanapickas 53609d6d09 newsfragments: Add release note for MR !619
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/619

(cherry picked from commit f02ee333b7f75d495ea9cdf4ec2724adb64794c4)
2021-12-30 20:05:15 +02:00
Povilas Kanapickas c0f0c82467 newsfragments: Add release note for MR !618
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/618

(cherry picked from commit 69e70e898624880da18be48d6cf22eacf3eababb)
2021-12-30 20:05:14 +02:00
Povilas Kanapickas c7b3ffc5bb newsfragments: Add release note for MR !617
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/617

(cherry picked from commit c6601d96059b1137bf620fe7b3a13426c56607c0)
2021-12-30 20:05:13 +02:00
Povilas Kanapickas 465e5867cb newsfragments: Add release note for MR !613
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/613
2021-12-30 20:05:12 +02:00
Povilas Kanapickas 156eba8dea newsfragments: Add release note for MR !612
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/612

(cherry picked from commit a1c0b4e36cfb356674988c56e478218399fcd583)
2021-12-30 20:05:11 +02:00
Povilas Kanapickas 4931efc5c7 newsfragments: Add release note for MR !609
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/609

(cherry picked from commit 295352c529047a0696a87b74d64d2b2996210a93)
2021-12-30 20:05:10 +02:00
Povilas Kanapickas edfe281aa7 newsfragments: Add release note for MR !607
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/607

(cherry picked from commit 10ab653c07f62363e1a7b206a7292d235dfeaf77)
2021-12-30 20:05:09 +02:00
Povilas Kanapickas c3d537c586 newsfragments: Add release note for MR !605
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/605

(cherry picked from commit 41ba2922c72ced8ef130bd6dcf5b6afbacfca4e8)
2021-12-30 20:05:08 +02:00
Povilas Kanapickas a0fc5c871c newsfragments: Add release note for MR !604
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/604

(cherry picked from commit d0484425b497f2b698cedfd2f607ed17efc63baf)
2021-12-30 20:05:07 +02:00
Povilas Kanapickas 68fddf92f3 newsfragments: Add release note for MR !651
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/651

(cherry picked from commit bda6796748e08100e27bc17d9004555e4614f1c6)
2021-12-30 20:05:06 +02:00
Povilas Kanapickas 9bd3d6ddf2 newsfragments: Add release note for MR !650
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/650

(cherry picked from commit 007c457bb6798377f7767e3e1b1174216cef366a)
2021-12-30 20:05:05 +02:00
Povilas Kanapickas 6545aa5ea8 newsfragments: Add release note for MR !550
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/550

(cherry picked from commit 7f28c1fa00cbd6f571de737d46f46c8c9f01dd9b)
2021-12-30 20:05:04 +02:00
Povilas Kanapickas dcfbf4f6d5 newsfragments: Add release note for MR !647
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/647

(cherry picked from commit 2c4ebcd9241d96fbc0950baa02a41b5a70be52ce)
2021-12-30 20:05:03 +02:00
Povilas Kanapickas f5ed3eaf71 newsfragments: Add release note for MR !645
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/645

(cherry picked from commit 494e2b55587beacb99d9fb09efaaf588aafa15fc)
2021-12-30 20:05:02 +02:00
Povilas Kanapickas 4634c4bde3 newsfragments: Add release note for MR !643
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/643

(cherry picked from commit 24a5d6f4c7bfd999a4e88f0efecc32a8ec36e705)
2021-12-30 20:05:01 +02:00
Povilas Kanapickas 094750b1df newsfragments: Add release note for MR !642
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/642

(cherry picked from commit 885574ccc2a98ac034455f3c2dc391e261238da8)
2021-12-30 20:05:00 +02:00
Povilas Kanapickas 506f6f5085 newsfragments: Add release note for MR !641
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/641

(cherry picked from commit 692ac5d8d96d36d9f7e49996d6c8bd8c48410887)
2021-12-30 20:04:59 +02:00
Povilas Kanapickas 9a06a54452 newsfragments: Add release note for MR !640
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/640

(cherry picked from commit f5e6f926392be74cda787a8d5248a5b7a03f745c)
2021-12-30 20:04:58 +02:00
Povilas Kanapickas d9b1139927 newsfragments: Add release note for MR !639
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/639

(cherry picked from commit 01614368715e93956bcc116b55e80c88dbc285f5)
2021-12-30 20:04:57 +02:00
Povilas Kanapickas 0a8e8a3d4d newsfragments: Add release notes for MR !638
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/638

(cherry picked from commit ab5b9b2293e0b689ce51baa951a1859f95fa3455)
2021-12-30 20:04:56 +02:00
Povilas Kanapickas 6fc8dc5a02 newsfragments: Add release note for MR !635
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/635

(cherry picked from commit 77c3626c4b5b108b66f8764940d92f8da3e5a545)
2021-12-30 20:04:55 +02:00
Povilas Kanapickas 33ec34cfe3 newsfragments: Add release note for MR !634
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/634

(cherry picked from commit f89a4be7049f498e0fc5e7a698cc6751bc86495a)
2021-12-30 20:04:54 +02:00
Povilas Kanapickas 247fc90a39 newsfragments: Add release note for MR !629
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/629

(cherry picked from commit 10fea431c39c118996f3d8624ea04b24c43792d3)
2021-12-30 20:04:53 +02:00
Povilas Kanapickas cd0b7ed82f newsfragments: Add release note for MR !627
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/627

(cherry picked from commit 0e20fd74dee4c0ae9140d1c023ae66e6a2df621d)
2021-12-30 20:04:52 +02:00
Povilas Kanapickas c21f16c11a NEWS: Move unreleased release notes to newsfragments directory
(cherry picked from commit 8ca61ed2dae709810a91919347d7890bcda55998)
2021-12-30 20:04:51 +02:00
Povilas Kanapickas 0169fe6f84 newsfragments: Document how to provide release notes
(cherry picked from commit 74cd7d0a7bb4d228f72c4957e9914634c2033cbc)
2021-12-30 20:04:50 +02:00
Povilas Kanapickas 8c5ea25efa Merge branch 'genesys-remove-gpl-exception' into 'master'
genesys: Remove exception for the GPL license

See merge request sane-project/backends!677
2021-12-30 17:32:07 +00:00
Povilas Kanapickas 23fb2a2139 Merge branch 'release-notes' into 'master'
Add release notes for all notable changes since 1.0.32

See merge request sane-project/backends!676
2021-12-30 17:22:36 +00:00
Povilas Kanapickas 59506f866d genesys: Remove exception for the GPL license
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.
2021-12-30 19:16:54 +02:00
Povilas Kanapickas fec5e8917f newsfragments: Add release note for MR !622
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/622
2021-12-30 19:00:18 +02:00
Povilas Kanapickas a27f807608 newsfragments: Add release note for MR !621
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/621
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 2f7da02d94 newsfragments: Add release note for MR !620
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/620
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 6832c5f399 newsfragments: Add release note for MR !619
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/619
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 27598c7889 newsfragments: Add release note for MR !618
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/618
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 451761272e newsfragments: Add release note for MR !617
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/617
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 86e138bea4 newsfragments: Add release note for MR !613
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/613
2021-12-30 19:00:18 +02:00
Povilas Kanapickas ebee3c2970 newsfragments: Add release note for MR !612
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/612
2021-12-30 19:00:18 +02:00
Povilas Kanapickas bdb4aa1585 newsfragments: Add release note for MR !609
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/609
2021-12-30 19:00:18 +02:00
Povilas Kanapickas b06e024be7 newsfragments: Add release note for MR !607
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/607
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 0feacf6f58 newsfragments: Add release note for MR !605
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/605
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 6773f79086 newsfragments: Add release note for MR !604
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/604
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 2f31fea9d3 newsfragments: Add release note for MR !675
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/675
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 9887b162d9 newsfragments: Add release note for MR !673
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/673
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 85b6cd3320 newsfragments: Add release note for MR !671
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/671
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 77baf258b6 newsfragments: Add release note for MR !669
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/669
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 3b91ab76e6 newsfragments: Add release note for MR !667
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/667
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 87778eef50 newsfragments: Add release note for MR !666
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/666
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 58007470e0 newsfragments: Add release note for MR !665 2021-12-30 19:00:18 +02:00
Povilas Kanapickas 5b1b012047 newsfragments: Add release note for MR !663
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/663
2021-12-30 19:00:18 +02:00
Povilas Kanapickas cb6a7d0a90 newsfragments: Add release note for MR !659
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/659
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 5695b15dfc newsfragments: Add release note for MR !658
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/658
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 3dfaea18bb newsfragments: Add release note for MR !657
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/657
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 2dff4aa09a newsfragments: Add release note for MR !654
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/654
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 034fa489b6 newsfragments: Add release note for MR !651
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/651
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 33b6e0ae47 newsfragments: Add release note for MR !650
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/650
2021-12-30 19:00:18 +02:00
Povilas Kanapickas bed836adad newsfragments: Add release note for MR !550
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/550
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 39d1f6a80a newsfragments: Add release note for MR !647
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/647
2021-12-30 19:00:18 +02:00
Povilas Kanapickas dc3146a31c newsfragments: Add release note for MR !645
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/645
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 7cbb3ae1d4 newsfragments: Add release note for MR !643
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/643
2021-12-30 19:00:18 +02:00
Povilas Kanapickas e9b3e39536 newsfragments: Add release note for MR !642
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/642
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 520a0df0f7 newsfragments: Add release note for MR !641
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/641
2021-12-30 19:00:18 +02:00
Povilas Kanapickas d666430f75 newsfragments: Add release note for MR !640
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/640
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 94933f881d newsfragments: Add release note for MR !639
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/639
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 7e2d4efd55 newsfragments: Add release notes for MR !638
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/638
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 7c215610c4 newsfragments: Add release note for MR !635
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/635
2021-12-30 19:00:18 +02:00
Povilas Kanapickas d9e722af63 newsfragments: Add release note for MR !634
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/634
2021-12-30 19:00:18 +02:00
Povilas Kanapickas cc88c73ac9 newsfragments: Add release note for MR !633
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/633
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 35de63ca99 newsfragments: Add release note for MR !629
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/629
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 5b143760f3 newsfragments: Add release note for MR !627
Full link: https://gitlab.com/sane-project/backends/-/merge_requests/627
2021-12-30 19:00:18 +02:00
Povilas Kanapickas c94a331916 newsfragments: Add release note for MR !628
https://gitlab.com/sane-project/backends/-/merge_requests/628
2021-12-30 19:00:18 +02:00
Povilas Kanapickas 141964f652 NEWS: Move unreleased release notes to newsfragments directory 2021-12-30 19:00:18 +02:00
Povilas Kanapickas 0b31b2c1ed newsfragments: Document how to provide release notes 2021-12-30 19:00:18 +02:00
Povilas Kanapickas 5591ce7c1b Merge branch 'genesys-remove-gl847-unsupported-resolutions' into 'master'
genesys: Remove unsupported resolutions on LiDE 100 and 200

Closes #383

See merge request sane-project/backends!675
2021-12-28 01:29:03 +00:00
Povilas Kanapickas eca148dbf4 genesys: Remove unsupported 75 and 100 dpi resolutions on LiDE 200 2021-12-28 02:49:59 +02:00
Povilas Kanapickas c86564a3e3 genesys: Remove unsupported 75 and 100 dpi resolutions on LiDE 100 2021-12-28 02:49:58 +02:00
Povilas Kanapickas f5d5928346 genesys: Log the target motor speed in case it can't be acquired 2021-12-28 02:49:57 +02:00
Povilas Kanapickas 87f27311f7 Merge branch 'release-1.0.33-backports' into 'release-1.0.33'
[1.0.33] Miscellaneous backports

See merge request sane-project/backends!674
2021-12-27 21:26:53 +00:00
Povilas Kanapickas 7353cd598b genesys: Remove unneeded per-scanner register setup
These register values are overwritten later.
2021-12-27 23:11:35 +02:00
Povilas Kanapickas 022f631611 genesys: Fixed offset calibration on certain gl841 devices 2021-12-27 23:11:35 +02:00
Povilas Kanapickas 374ba39e46 genesys: Use consistent initial exposure for led calibration on gl841 2021-12-27 23:11:35 +02:00
Povilas Kanapickas 9527a9e623 genesys: Fix inconsistent exposure values in led calib in testing mode 2021-12-27 23:11:35 +02:00
Povilas Kanapickas 8eb2c0e404 genesys: Ensure sensor exposure is up-to-date when scanning on gl841 2021-12-27 23:11:35 +02:00
Povilas Kanapickas dd1abe9380 genesys: Reuse gl124 led calibration acceptability criteria for gl841 2021-12-27 23:11:35 +02:00
Povilas Kanapickas 9611b9d757 genesys: Remove no longer used led calibration fallback code on gl841
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.
2021-12-27 23:11:35 +02:00
Povilas Kanapickas b3f6637ae2 genesys: Specify target white level for all gl841 devices 2021-12-27 23:11:35 +02:00
Povilas Kanapickas 4d1246b507 genesys: Remove duplicate register write during led calibration on gl841 2021-12-27 23:11:35 +02:00
Povilas Kanapickas 408ee7a770 genesys: Reset registers after move during led calibration on gl841 2021-12-27 23:11:35 +02:00
Povilas Kanapickas 9669c6c335 genesys: Remove erroneous register write on LiDE 80 2021-12-27 23:11:35 +02:00
Povilas Kanapickas bafd6e134a genesys: Clean up exposure calibration on gl841 2021-12-27 23:11:35 +02:00
Povilas Kanapickas 4fce71b55b genesys: Use more robust gain calibration on gl841 2021-12-27 23:11:35 +02:00
Povilas Kanapickas cc3bf08055 genesys: Remove duplicate register writes in gl841 calibration 2021-12-27 23:11:35 +02:00
Povilas Kanapickas 7dcffcf75f genesys: Use host-side gray instead of device-side true-gray on gl841
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.
2021-12-27 23:11:34 +02:00
Povilas Kanapickas 440ec4f80c genesys: Implement host-side gray support 2021-12-27 23:11:12 +02:00
Povilas Kanapickas 6bec3fcfa6 genesys: Implement image pipeline for merging color channels to gray 2021-12-27 23:11:12 +02:00
Povilas Kanapickas b7b37b4f45 genesys: Rename ImagePipelineNodeMergeMono{Lines -> LinesToColor} 2021-12-27 23:11:12 +02:00
Povilas Kanapickas e64aad283f genesys: Remove true_gray variable by deriving its value directly 2021-12-27 23:11:12 +02:00
Povilas Kanapickas 72d0c39656 genesys: Fix incorrect scan exposure setup on gl841
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
2021-12-27 23:11:12 +02:00
Povilas Kanapickas 7b25c36c15 genesys: Inline gl841_get_led_exposure() 2021-12-27 23:11:12 +02:00
Povilas Kanapickas 341b2ff6e6 genesys: Remove broken two-table feeding support from gl841
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.
2021-12-27 23:11:12 +02:00
Povilas Kanapickas df20a7a46e genesys: Remove unused two-table feeding support from gl847 2021-12-27 23:11:12 +02:00
Povilas Kanapickas 3787dfdb4b genesys: Remove unused two-table feeding support from gl846 2021-12-27 23:11:12 +02:00
Povilas Kanapickas 491a08ba96 genesys: Remove unused two-table feeding support from gl124 2021-12-27 23:11:12 +02:00
Povilas Kanapickas c6df5fd69a genesys: Enable gamma setting when contrast or brightness is adjusted
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.
2021-12-27 23:11:08 +02:00
Povilas Kanapickas 2cc2f8a26b genesys: Store contrast and brightness adjustments in session params 2021-12-27 23:11:08 +02:00
Povilas Kanapickas 4d2a6eb513 Merge branch 'genesys-gl841-fixes' into 'master'
genesys: Various fixes for GL841 scanners

Closes #357

See merge request sane-project/backends!673
2021-12-27 21:08:39 +00:00
Povilas Kanapickas 75ac76f87a genesys: Remove unneeded per-scanner register setup
These register values are overwritten later.
2021-12-27 22:39:19 +02:00
Povilas Kanapickas f06e507de7 genesys: Fixed offset calibration on certain gl841 devices 2021-12-27 22:39:19 +02:00
Povilas Kanapickas 334e4bd8d1 genesys: Use consistent initial exposure for led calibration on gl841 2021-12-27 22:39:19 +02:00
Povilas Kanapickas af175f6d4c genesys: Fix inconsistent exposure values in led calib in testing mode 2021-12-27 22:39:19 +02:00
Povilas Kanapickas 3e9431d079 genesys: Ensure sensor exposure is up-to-date when scanning on gl841 2021-12-27 22:39:19 +02:00
Povilas Kanapickas c11a0e7ab6 genesys: Reuse gl124 led calibration acceptability criteria for gl841 2021-12-27 22:39:19 +02:00
Povilas Kanapickas d19ccd2fad genesys: Remove no longer used led calibration fallback code on gl841
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.
2021-12-27 22:39:19 +02:00
Povilas Kanapickas e540778cfa genesys: Specify target white level for all gl841 devices 2021-12-27 22:39:19 +02:00
Povilas Kanapickas c1f731a7e0 genesys: Remove duplicate register write during led calibration on gl841 2021-12-27 22:39:19 +02:00
Povilas Kanapickas f1910ae58c genesys: Reset registers after move during led calibration on gl841 2021-12-27 22:39:19 +02:00
Povilas Kanapickas 86fe51e224 genesys: Remove erroneous register write on LiDE 80 2021-12-27 22:39:19 +02:00
Povilas Kanapickas 0f341bf5a0 genesys: Clean up exposure calibration on gl841 2021-12-27 22:39:19 +02:00
Povilas Kanapickas 4ee36a2e31 genesys: Use more robust gain calibration on gl841 2021-12-27 22:39:19 +02:00
Povilas Kanapickas bbc1543525 genesys: Remove duplicate register writes in gl841 calibration 2021-12-27 22:39:19 +02:00
Povilas Kanapickas 675497fcd8 genesys: Use host-side gray instead of device-side true-gray on gl841
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.
2021-12-27 22:39:19 +02:00
Povilas Kanapickas 7bbb6d8fdb genesys: Implement host-side gray support 2021-12-27 22:39:19 +02:00
Povilas Kanapickas 2f030f04e2 genesys: Implement image pipeline for merging color channels to gray 2021-12-27 22:22:44 +02:00
Povilas Kanapickas ad84284186 genesys: Rename ImagePipelineNodeMergeMono{Lines -> LinesToColor} 2021-12-27 22:22:44 +02:00
Povilas Kanapickas bd4f009122 genesys: Remove true_gray variable by deriving its value directly 2021-12-27 22:22:44 +02:00
Povilas Kanapickas 1e75025048 genesys: Fix incorrect scan exposure setup on gl841
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
2021-12-27 22:22:44 +02:00
Povilas Kanapickas 601705fa3a genesys: Inline gl841_get_led_exposure() 2021-12-27 22:22:44 +02:00
Povilas Kanapickas 6c0fafac79 genesys: Remove broken two-table feeding support from gl841
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.
2021-12-27 22:22:44 +02:00
Povilas Kanapickas e27d991fdf genesys: Remove unused two-table feeding support from gl847 2021-12-27 22:22:44 +02:00
Povilas Kanapickas d4dc13f527 genesys: Remove unused two-table feeding support from gl846 2021-12-27 22:22:44 +02:00
Povilas Kanapickas 137a2d676f genesys: Remove unused two-table feeding support from gl124 2021-12-27 22:22:44 +02:00
Povilas Kanapickas f4552acf8d Merge branch 'pixma_new_models' into 'master'
pixma: add 2021 models.

See merge request sane-project/backends!671
2021-12-27 14:49:08 +00:00
Ordissimo 584f16e2ee pixma: add 2021 models.
Fix white space

Fix build

Add descriptions

Reduces the length of the line
2021-12-27 16:33:37 +02:00
Ordissimo 8d028fe398 Merge branch 'scangearmp2_add_2021_modeles' into 'master'
Scangearmp2: add 2021 models

See merge request sane-project/backends!672
2021-12-27 13:43:20 +00:00
Ordissimo 020030080c Scangearmp2 add 2021 models 2021-12-27 14:23:37 +01:00
Povilas Kanapickas 53c1be6ae8 Merge branch 'genesys-cleanup' into 'master'
genesys: Miscellaneous cleanups

See merge request sane-project/backends!670
2021-12-26 14:53:11 +00:00
Povilas Kanapickas b668e92047 genesys: Use {uint,int}{8,16,32,64} from std namespace
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.
2021-12-26 16:09:17 +02:00
Povilas Kanapickas 7c76892b98 genesys: Remove empty file 2021-12-26 16:09:16 +02:00
Povilas Kanapickas 3752d11c34 genesys: Wrap very long lines 2021-12-26 16:09:15 +02:00
Povilas Kanapickas 7bc9983407 Merge branch 'genesys-fix-contrast-brightness' into 'master'
genesys: Enable gamma setting when contrast or brightness is adjusted

Closes #271

See merge request sane-project/backends!669
2021-12-26 13:15:18 +00:00
Povilas Kanapickas 80f6d21170 genesys: Enable gamma setting when contrast or brightness is adjusted
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.
2021-12-26 14:59:01 +02:00
Povilas Kanapickas bf4614b76e genesys: Store contrast and brightness adjustments in session params 2021-12-26 14:53:14 +02:00
Povilas Kanapickas a38919bf7f Merge branch 'release-1.0.33-backports' into 'release-1.0.33'
[1.0.33] Miscellaneous backports

See merge request sane-project/backends!668
2021-12-25 02:23:57 +00:00
Povilas Kanapickas eb097b632c genesys: Address wrong indentation warning
This is separate commit because the previous commit introducing this
warning is completely unrelated and would not benefit from this change
being included.

(cherry picked from commit 75801bffd3)
2021-12-25 04:08:03 +02:00
Ralph Little 944183c379 genesys: Added transparency button option
This is introduced primarily for the ScanJet G4010 which has "Scan Film"
buttons.

(cherry picked from commit 8347191b5f)
2021-12-25 04:08:03 +02:00
Ralph Little b83f7d3cad genesys: updated button support for HP Scanjet G4010
(cherry picked from commit fa414e46b1)
2021-12-25 04:08:03 +02:00
Peter Seiderer 0114403ac5 genesys: fix gcc-4.8 compile
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>
(cherry picked from commit 1db13a713f)
2021-12-25 04:08:03 +02:00
Povilas Kanapickas 63fffd7403 genesys: Improve gray scan quality on LiDE 110
The fix has been suggested by Matthew Petroff <matthew@mpetroff.net>

(cherry picked from commit ea0e57a05e)
2021-12-25 04:07:51 +02:00
Povilas Kanapickas cf8835625a genesys: Improve gray scan quality on LiDE 120
The fix has been suggested by Matthew Petroff <matthew@mpetroff.net>

(cherry picked from commit 8ceb1dde8d)
2021-12-25 04:07:51 +02:00
Povilas Kanapickas 3a890c7100 genesys: Improve gray scan quality on LiDE 210
The fix has been suggested by Matthew Petroff <matthew@mpetroff.net>

(cherry picked from commit 711a3c5c14)
2021-12-25 04:07:51 +02:00
Povilas Kanapickas b16baa642b genesys: Improve gray scan quality on LiDE 220
The fix has been suggested by Matthew Petroff <matthew@mpetroff.net>

(cherry picked from commit 723eaa5917)
2021-12-25 04:07:51 +02:00
Povilas Kanapickas 8414a1db9b genesys: Move gl124 0x0c reg definition to sensor tables
(cherry picked from commit bd0f15f585)
2021-12-25 04:07:51 +02:00
Povilas Kanapickas bffda89bc7 backend/Makefile: Reduce excessive line lengths
(cherry picked from commit ed51223cfb)
2021-12-25 04:03:40 +02:00
Wolfram Sang 1c8bb97b69 epson2: add driver to main sane manpage
Reported missing by A E Lawrence via mail. Thanks!

(cherry picked from commit bb94182982)
2021-12-25 04:03:40 +02:00
Wolfram Sang d6189aa789 epson2/epsonds: add new IDs provided by Epson
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>

(cherry picked from commit 91c24b2955)
2021-12-25 04:03:40 +02:00
Ordissimo 5152108769 Fix segfault sane-escl.
(cherry picked from commit 72992f4e25)
2021-12-25 04:03:39 +02:00
Jindřich Makovička 59b669ae3c escl: Follow the 302 redirects
Recent ipp-usb redirects from http://127.0.0.1 to http://localhost

(cherry picked from commit 1b5344ba56)
2021-12-25 04:03:39 +02:00
Povilas Kanapickas fcda028e4a Merge branch 'genesys-lide-gray' into 'master'
genesys: Improve gray scan quality on LiDE 220

Closes #52 and #106

See merge request sane-project/backends!667
2021-12-25 01:57:10 +00:00
Povilas Kanapickas ea0e57a05e genesys: Improve gray scan quality on LiDE 110
The fix has been suggested by Matthew Petroff <matthew@mpetroff.net>
2021-12-25 03:06:29 +02:00
Povilas Kanapickas 8ceb1dde8d genesys: Improve gray scan quality on LiDE 120
The fix has been suggested by Matthew Petroff <matthew@mpetroff.net>
2021-12-25 03:06:28 +02:00
Povilas Kanapickas 711a3c5c14 genesys: Improve gray scan quality on LiDE 210
The fix has been suggested by Matthew Petroff <matthew@mpetroff.net>
2021-12-25 03:06:27 +02:00
Povilas Kanapickas 723eaa5917 genesys: Improve gray scan quality on LiDE 220
The fix has been suggested by Matthew Petroff <matthew@mpetroff.net>
2021-12-25 03:06:26 +02:00
Povilas Kanapickas bd0f15f585 genesys: Move gl124 0x0c reg definition to sensor tables 2021-12-25 03:06:25 +02:00
Ordissimo 4b4cc5d019 Merge branch 'escl-add-new-models' into 'master'
escl:Added of 3 tested models

Closes #540

See merge request sane-project/backends!666
2021-12-23 09:03:08 +00:00
thierry1970 0a22da26c4 escl:Added of 3 tested models
Rename model
2021-12-23 09:30:37 +01:00
Ordissimo 98869ebedf Merge branch 'fix-old-tls-connections' into 'master'
Fix old tls connections

See merge request sane-project/backends!663
2021-12-17 12:13:07 +00:00
Ordissimo 7394329b69 Merge branch 'escl-ipv6' into 'master'
Escl ipv6

See merge request sane-project/backends!565
2021-12-16 11:09:33 +00:00
Povilas Kanapickas c8f42d6bd5 Merge branch 'devel/avision' into 'master'
Added support for Avision FB2280E

See merge request sane-project/backends!657
2021-12-16 11:08:40 +00:00
Povilas Kanapickas b72ac67a70 Merge branch 'R40' into 'master'
canon_dr: Add basic support for Canon R40 scanner

See merge request sane-project/backends!665
2021-12-16 10:56:23 +00: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
genkn b8df4a0cf6 canon_dr: Add basic support for Canon R40 scanner
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.
2021-12-16 12:24:34 +02:00
Povilas Kanapickas dd0599ca52 Merge branch 'fix-dev_acquire' into 'master'
xerox_mfp: return correct value in dev_acquire()

See merge request sane-project/backends!614
2021-12-16 10:15:41 +00:00
Andrew Sayers 40f4885ab8 xerox_mfp: return correct value in dev_acquire()
dev_acquire() is expected to return 1 on success and 0 on failure.
Fix the cases where it returned non-zero on error.
2021-12-16 11:59:52 +02:00
Ralph Little bfa3e39de2 Merge branch 'scanjet_g4010' into 'master'
Updated button support for HP Scanjet G4010

See merge request sane-project/backends!622
2021-12-16 05:00:36 +00:00
thierry1970 d77743b243 Search for the TLS version used by the device, then force the TLS version if necessary.
Check constant curl_ssl

Fix build
2021-12-16 00:30:56 +01:00
Thierry HUCHARD 4752a9c379 added support for ipv6.
Fixes a possible memory overflow.
2021-12-15 23:30:02 +01:00
Povilas Kanapickas db6e4fd77f Merge branch 'xerox_workcentre_3025' into 'master'
Add Xerox WorkCentre 3025

See merge request sane-project/backends!654
2021-12-15 22:21:53 +00:00
Povilas Kanapickas 7b19eb2115 Merge branch 'pixma-mf56x0' into 'master'
pixma: move MF56x0 to MP730 backend

See merge request sane-project/backends!628
2021-12-15 22:17:12 +00:00
Povilas Kanapickas dc32df1001 Merge branch 'ps-devel-fix-gcc-4-8-compile-001' into 'master'
genesys: fix gcc-4.8 compile

See merge request sane-project/backends!609
2021-12-15 22:12:13 +00:00
Andrii Pravorskyi 9ed6873292 xerox_mfp: Add Xerox WorkCentre 3025 2021-12-16 00:06:04 +02:00
Konstantin Tcepliaev 0a038376a6 pixma: move MF56x0 to MP730 backend 2021-12-16 00:01:53 +02:00
Povilas Kanapickas 75801bffd3 genesys: Address wrong indentation warning
This is separate commit because the previous commit introducing this
warning is completely unrelated and would not benefit from this change
being included.
2021-12-15 23:59:28 +02:00
Ralph Little 8347191b5f genesys: Added transparency button option
This is introduced primarily for the ScanJet G4010 which has "Scan Film"
buttons.
2021-12-15 23:59:28 +02:00
Ralph Little fa414e46b1 genesys: updated button support for HP Scanjet G4010 2021-12-15 23:59:28 +02:00
Peter Seiderer 1db13a713f genesys: fix gcc-4.8 compile
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>
2021-12-15 23:56:23 +02:00
Povilas Kanapickas 9ad2aa54b9 Merge branch '519-imageRUNNER1133A-support' into 'master'
Added support for imageRUNNER1133A

See merge request sane-project/backends!658
2021-12-15 21:39:12 +00:00
Mikhail Remnev d32e6c4115 Added iclass_device for imageRUNNER1133A 2021-12-15 23:23:08 +02:00
Povilas Kanapickas 2e77ac4052 Merge branch 'add-sanei-directio' into 'master'
Factoring of umax_pp_low functions concerning sys/io.h

See merge request sane-project/backends!521
2021-12-15 20:55:28 +00:00
Thierry HUCHARD 8090d3844b tools: Reuse sanei_directio 2021-12-15 22:39:51 +02:00
Thierry HUCHARD c7575b3679 plustek-pp: Reuse sanei_directio for inb/outb 2021-12-15 22:39:46 +02:00
Thierry HUCHARD 8a2a81a83c sanei: Remove no longer used code from sanei_backend.h 2021-12-15 22:39:43 +02:00
Thierry HUCHARD ab11e42894 sanei: Reuse sanei_directio in sanei_pio 2021-12-15 22:39:40 +02:00
Thierry HUCHARD 7d75dbad0c sanei: Remove BEOS support from sanei_pio 2021-12-15 22:39:38 +02:00
Thierry HUCHARD 3e8885f937 sanei: Reuse sanei_directio in sanei_pa4s2 2021-12-15 22:39:36 +02:00
Thierry HUCHARD abbc93df1a qcam: Reuse sanei_directio 2021-12-15 22:39:33 +02:00
Thierry HUCHARD 79e470cf9a sanei: Reuse sanei_directio in sanei_ab306 2021-12-15 22:39:31 +02:00
Thierry HUCHARD db83d55495 sanei: Reuse sanei_directio in sanei_pp 2021-12-15 22:39:28 +02:00
Thierry HUCHARD 7b5386ff6e Factoring of umax_pp_low functions concerning sys/io.h to sanei lib 2021-12-15 22:39:25 +02:00
Thierry HUCHARD 374521c4b6 p5_device: Rename inb/out/INB to prevent name clashes 2021-12-15 22:39:17 +02:00
Povilas Kanapickas 7f06490c93 Merge branch 'makefile-no-long-lines' into 'master'
backend/Makefile: Reduce excessive line lengths

See merge request sane-project/backends!664
2021-12-13 21:47:00 +00:00
Povilas Kanapickas ed51223cfb backend/Makefile: Reduce excessive line lengths 2021-12-13 22:45:51 +02:00
Povilas Kanapickas 96277ac052 Merge branch 'epjitsu-cleanup' into 'master'
A few cleanups & fixes to the epjitsu backend

See merge request sane-project/backends!662
2021-12-08 14:53:34 +00:00
Peter Marschall d829ff835a epjitsu: read page_width pixels from scanner
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>
2021-12-08 16:36:14 +02:00
Peter Marschall 79e76258cb epjitsu: enforce range.max >= range.min in option descriptors
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>
2021-12-08 16:36:14 +02:00
Peter Marschall 1dab1f0121 epjitsu: fix start & finish DBG() calls in coarsecal*()
Adapt levels for start & finish logging to match the documentation
and the other functions.

Signed-off-by: Peter Marschall <peter@adpm.de>
2021-12-08 16:36:14 +02:00
Peter Marschall 16cdaf16e5 epjitsu: instrument finecal_send_cal() & finecal_get_line() with DBG() calls
No functional changes, but allow for easier debugging.

Signed-off-by: Peter Marschall <peter@adpm.de>
2021-12-08 16:36:13 +02:00
Peter Marschall 36b59bd2c1 epjitsu: introduce & use MAX() & MIN()
This change simplifies some expressions, and hence
allows for easier understanding of the intention.

Signed-off-by: Peter Marschall <peter@adpm.de>
2021-12-08 16:36:13 +02:00
Wolfram Sang b183f6a055 Merge branch 'epson2/add_to_main_manpage' into 'master'
epson2: add driver to main sane manpage

See merge request sane-project/backends!660
2021-12-08 08:48:45 +00:00
Wolfram Sang 952976c6a6 Merge branch 'epson2/more_ids' into 'master'
epson2/epsonds: add new IDs provided by Epson

See merge request sane-project/backends!659
2021-12-08 08:47:29 +00:00
Ralph Little 5ecd4a9d3e Merge branch 'canon_xk90_ts8030' into 'master'
pixma: Added testing information for Canon XK90 and added large image interleave.

See merge request sane-project/backends!661
2021-12-07 20:54:54 +00:00
Ralph Little 0bbf1155af pixma: Added testing information for Canon XK90 and added large image interleave. 2021-12-07 20:54:54 +00:00
Wolfram Sang bb94182982 epson2: add driver to main sane manpage
Reported missing by A E Lawrence via mail. Thanks!
2021-12-03 13:53:10 +01:00
Wolfram Sang 91c24b2955 epson2/epsonds: add new IDs provided by Epson
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>
2021-12-03 12:36:33 +01:00
Ordissimo 3b47d1d26a Merge branch 'escl-segfault' into 'master'
Fix segfault sane-escl.

See merge request sane-project/backends!653
2021-10-21 06:58:39 +00:00
Ordissimo 72992f4e25 Fix segfault sane-escl. 2021-10-20 22:25:10 +02:00
Ordissimo 3440ef60b3 Merge branch 'master' into 'master'
escl: Follow the 302 redirects

See merge request sane-project/backends!652
2021-10-18 11:45:22 +00:00
Jindřich Makovička 1b5344ba56 escl: Follow the 302 redirects
Recent ipp-usb redirects from http://127.0.0.1 to http://localhost
2021-10-14 20:05:19 +02:00
Ralph Little 0c1faae1de Merge branch 'test_int_inexact_option' into 'master'
Add int_inexact option to test SANE_INFO_INEXACT.

See merge request sane-project/backends!633
2021-10-14 14:47:51 +00:00
Ralph Little 3a5f128e8a Add int_inexact option to test SANE_INFO_INEXACT. 2021-10-14 14:47:51 +00:00
Ordissimo 65b6684984 Merge branch 'pdf-on' into 'master'
The name of the device, allows to disable the use of the PDF format.

See merge request sane-project/backends!651
2021-09-26 06:35:31 +00:00
Ordissimo 88934578ec The name of the device, allows to disable the use of the PDF format. 2021-09-26 06:35:31 +00:00
Ordissimo 66f2673d71 Merge branch 'add-format-pdf' into 'master'
Add format pdf.

See merge request sane-project/backends!648
2021-09-22 15:14:15 +00:00
Ordissimo d25f5db739 Add format pdf. 2021-09-22 15:14:15 +00:00
Wolfram Sang 55ac7b3060 Merge branch 'kkaempf/add_Reflecta_RPS_10M' into 'master'
Add Reflecta RPS 10M to pieusb

See merge request sane-project/backends!650
2021-09-22 10:18:26 +00:00
Klaus Kämpf d12533fced Add Reflecta RPS 10M to pieusb
(aka Pacific Image PrimeFilm XAs)

Thanks to Thomas Wilshaw for testing.

Signed-off-by: Klaus Kämpf <kkaempf@suse.de>
2021-09-21 14:25:16 +02:00
Ralph Little 8ad3b1127f po: en_Gb translation.
Nothing much to do.
Just a couple of new msgs from the epsonds backend update.
2021-09-20 20:31:33 -07:00
Ralph Little c540a3a354 po: update po files prior to translations for release 1.0.33 2021-09-20 20:09:29 -07:00
Ralph Little 66d65ba37d Merge branch 'uk_update1' into 'master'
po: Update Ukrainian translation

See merge request sane-project/backends!649
2021-09-21 03:05:57 +00:00
Yuri Chornoivan 5698be8cce po: Update Ukrainian translation 2021-09-20 19:47:14 +03:00
Wolfram Sang a3558af0fc Merge branch 'epson2-uninitialized' into 'master'
epson2: fix up uninitialized variables

See merge request sane-project/backends!636
2021-09-18 18:38:12 +00:00
pimvantend 54e3fb2094 Added the lide70 news to NEWS, in view of the upcoming release.
Removed gamma remark from lide70 manpage:
default color quality is getting better, though still not perfect.
2021-09-06 16:19:04 +02:00
Ordissimo 1d191ab801 Merge branch 'escl-add-models' into 'master'
Escl add models Epson ET-6100

See merge request sane-project/backends!647
2021-08-31 20:09:33 +00:00
Ordissimo e1b5c43b56 Escl add models Epson ET-6100 2021-08-31 20:09:33 +00:00
Adriaan de Groot 0400e23d30 uninitialized: set *status on all returns out of e2_ssend() 2021-08-30 17:45:21 +02:00
Ralph Little 563afbe0fa Merge branch '505-issues-in-man-pages' into 'master'
Resolve "Issues in man pages"

Closes #505

See merge request sane-project/backends!646
2021-08-29 23:16:42 +00:00
Ralph Little e84dc47f73 doc: errors corrected by translator.
Many thanks to translator hmartink for raising these issues.
2021-08-29 16:00:23 -07:00
Ordissimo c3cdf4102c Update pixma.desc 2021-08-28 09:03:42 +00:00
Ordissimo 2ad66b6bec Merge branch 'add-models' into 'master'
Add models

See merge request sane-project/backends!645
2021-08-27 19:00:26 +00:00
Ordissimo fc99bbe784 Add models 2021-08-27 19:00:26 +00:00
Ordissimo c798d85eaf Merge branch 'cleaning-doc-escl' into 'master'
Alphabetical classification by make and model

See merge request sane-project/backends!644
2021-08-27 14:53:31 +00:00
thierry1970 94f25af5d8 Alphabetical classification by make and model 2021-08-27 16:09:09 +02:00
Ordissimo 26749cee53 Merge branch 'fix-redirection-curl' into 'master'
Fix redirect request.

See merge request sane-project/backends!643
2021-08-23 07:57:32 +00:00
Ordissimo 4929387246 Fix redirect request. 2021-08-23 07:57:32 +00:00
Ordissimo 1ba63878e4 Merge branch 'canon-pixma-new-model' into 'master'
Canon pixma new model

See merge request sane-project/backends!642
2021-08-10 20:32:29 +00:00
Ordissimo 47963e059e Canon pixma new model 2021-08-10 20:32:29 +00:00
Wolfram Sang f5b4e914c6 Merge branch 'epson-xp-455' into 'master'
epson2: Add XP-452 455 Series as supported

See merge request sane-project/backends!641
2021-08-03 20:21:38 +00:00
John Keeping 6ea78a79ca epson2: Add XP-452 455 Series as supported
Tested via simple-scan with a device branded as XP-455 but which
identifies in the device descriptor's product string as "XP-452 455
Series".
2021-07-31 18:04:26 +01:00
Ordissimo c6fd7de5f1 Merge branch 'escl-support-TR7500' into 'master'
Escl support tr4520 and tr7500

See merge request sane-project/backends!640
2021-07-29 15:34:30 +00:00
Ordissimo 4c99352dda Escl support tr4520 and tr7500 2021-07-29 15:34:29 +00:00
Ralph Little 9a0fa0da86 Merge branch '231-canon-lide-120-wrong-size-with-y-x-after-update-to-sane-backends-1-0-28-1078-g5747ffa9' into 'master'
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
2021-07-17 22:40:54 +00:00
Ralph Little 7b2c4a0bf7 Merge branch 'epsonds_updates' 2021-07-03 15:59:39 -07:00
Ralph Little 1e88e1504e epsonds: Merge to master 2021-07-03 15:55:25 -07:00
Ralph Little bb8c0b088c epsonds: Correction from Epson for unused parameter fail in pipeline. 2021-07-02 09:31:12 -07:00
Ralph Little b74dfb3004 epsonds: corrections from Epson following first review.
Contains some rework to address concerns from pipeline build.
2021-06-22 12:41:44 -07:00
Ralph Little 9282aac9be epsonds: Fix up white space issues in patch.; 2021-06-20 14:57:08 -07:00
Ralph Little bc6035624d epsonds: major product support update from Epson.
Patch provided by Nakamura Iwao at Epson Japan.
2021-06-20 14:49:56 -07:00
Wolfram Sang 911be8af68 Merge branch 'cleanup_major_minor' into 'master'
treewide: use SANE_CURRENT_* macros consistently

See merge request sane-project/backends!632
2021-06-19 19:43:38 +00:00
Wolfram Sang 1a95dc7cde Merge branch 'gt68xx/proper_free' into 'master'
gt68xx: fix use-after-free and two mem leaks

See merge request sane-project/backends!634
2021-06-18 22:00:16 +00:00
Ralph Little 026430c293 Merge branch 'libera_chat' into 'master'
docs/sane.man: Move to libera.chat

See merge request sane-project/backends!637
2021-06-18 21:59:54 +00:00
Ralph Little e86175e726 Merge branch 'ps-devel-fix-microtek-va_list-001' into 'master'
Fix uclibc compile (include stdarg.h for va_list/va_start/va_end), fix NDEBUG compile (PDBG/pixma_dbg)

See merge request sane-project/backends!638
2021-06-18 19:08:15 +00:00
Peter Seiderer b1021e09e4 backend/pixma: fix compile with NDEBUG
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>
2021-06-18 20:10:02 +02:00
Peter Seiderer 7dafc52dda backend/sm3600-scanutil: fix uclibc compile (include stdarg.h for va_list/va_start/va_end)
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>
2021-06-18 19:56:56 +02:00
Peter Seiderer 145e16008e backend/microtek: fix uclibc compile (include stdarg.h for va_list/va_start/va_end)
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>
2021-06-18 19:51:45 +02:00
Zdenek Dohnal 7a28e66a16 docs/sane.man: Move to libera.chat 2021-06-17 08:58:44 +02:00
Ordissimo 980bb29cb8 Merge branch 'full-location-header' into 'master'
The job URL is adapted to the information provided by the value of the Location property.

See merge request sane-project/backends!635
2021-06-12 12:41:05 +00:00
thierry1970 667d8f7acc The job URL is adapted to the information provided by the value of the Location property. 2021-06-12 00:57:07 +02:00
Wolfram Sang 63942f7a74 gt68xx: fix use-after-free and two mem leaks
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.
2021-06-10 11:36:11 +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
Wolfram Sang a78abbbdba Merge branch 'epson2/cleanup-desc' into 'master'
epson2: cleanup desc and remove BUILD versioning

See merge request sane-project/backends!631
2021-06-08 16:58:30 +00:00
Wolfram Sang cadc4de1a7 descriptions: remove unneeded false :new flags
It is the default
2021-06-08 11:52:00 +02:00
Wolfram Sang be5b247180 epson2: desc: remove unneeded URL
No need for a generic URL at a specific scanner
2021-06-08 11:52:00 +02:00
Wolfram Sang 65b7e317a6 epson2: remove BUILD versioning
Makes no sense these days. Sane version is good enough.
2021-06-08 11:52:00 +02:00
Wolfram Sang cd1733c345 Merge branch 'epson2-new-usbids' into 'master'
epson2: improve sorting of usbids and add new ones provided by Epson

See merge request sane-project/backends!630
2021-06-08 05:14:40 +00:00
Wolfram Sang 53641f8342 epson2: add usb ids provided by Epson
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
2021-06-02 22:40:21 +02:00
Ralph Little ffa7a82900 po: remove trailing blank line, breaks pipeline 2021-05-31 21:57:37 -07:00
Ralph Little 19b9b41e4d po: Add zh_CN locale to build. 2021-05-31 21:54:23 -07:00
Ralph Little 257529d39e Merge branch 'master' into 'master'
Added SANE backend translation for Simplified Chinese.

See merge request sane-project/backends!629
2021-06-01 04:45:06 +00:00
Wolfram Sang db7a285e74 epson2: use 4 digits for USB IDs
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.
2021-05-29 12:22:55 +02:00
Wolfram Sang 28176df499 tools: epson2usb: always use 4 digits for USB IDs
Otherwise the sorting is too confusing when 3- and 4-digits are mixed.
2021-05-29 12:13:35 +02:00
pimvantend 075bd9b7e9 canon_lide70: faster and brighter scanning at 600dpi for the lide600 2021-05-25 14:25:28 +02:00
Tyson Tan b7055f4859 Corrected some entries from Ustushi's S-Chinese translations. 2021-05-21 13:55:05 +00:00
Tyson Tan 99f3783608 Added SANE backend translation for Simplified Chinese. 2021-05-21 08:34:57 +00:00
Ralph Little 2b0e4bc497 Merge branch 'scanimage_man_patch_update' into 'master'
doc: add man change clarification to deal with debian patch.

See merge request sane-project/backends!627
2021-05-13 15:44:34 +00:00
Ralph Little 28ad82bd42 doc: add man change clarification to deal with debian patch. 2021-05-13 15:44:33 +00:00
Ralph Little 8e85691dd9 Merge branch 'reformat-scanimage-options' into 'master'
doc: reformatted the main options of scanimage

See merge request sane-project/backends!626
2021-05-12 16:57:41 +00:00
Ralph Little 4fef6d6da1 doc: reformatted the main options of scanimage
Following the update of saned's man page, I have reformatted the
scanimage options section for consistency and to correct some omissions
and improve readability and grammar.
2021-05-12 09:29:04 -07:00
Ralph Little e81f6b5a57 doc: fix trailing whitespace issue 2021-05-07 11:05:48 -07:00
Ralph Little 37fe11acd2 Merge branch 'saned_man_option_update' into 'master'
doc: updated saned manpage to reflect saned.

See merge request sane-project/backends!624
2021-05-07 16:25:40 +00:00
Ralph Little 7f21e4cac8 doc: updated saned manpage to reflect saned.
saned supports long options and some clarification was necessary for
correctness. Also I reformatted the options section to be more
standard and consistent with other pages.
2021-05-07 09:23:28 -07:00
Ralph Little 28f7bbfb87 Merge branch 'master' into 'master'
Fix manpage typo

See merge request sane-project/backends!623
2021-05-07 16:07:36 +00:00
Rodrigo Osorio dde45eed5e Fix manpage typo
There is no such switch as -B in scanned
2021-05-07 10:18:22 +02:00
pimvantend 3f80ebae93 lide70 and 600: many simplifications 2021-04-18 17:47:49 +02:00
Wolfram Sang 0943bf00bd Merge branch 'epson2/better_timeouts' into 'master'
epson2: better timeouts

See merge request sane-project/backends!605
2021-04-09 19:36:06 +00:00
Ralph Little 75575e0888 epson2: Wolfram Sang is now the maintainer for this backend. 2021-04-08 09:37:24 -07:00
Ralph Little 7b7b36e593 Merge branch '464-genesys-backend-crashes-during-exception-handling' into 'master'
Resolve "genesys backend crashes during exception handling"

Closes #464

See merge request sane-project/backends!621
2021-04-07 16:24:08 +00:00
Ralph Little 730e4ada37 genesys: fixed indentation again.
Hopefully, I will get it right this time. Uses 4 space indents rather
than 2 as used elsewhere in the code base.
2021-04-07 09:06:39 -07:00
Ralph Little 5702046a9c genesys: fix indentation 2021-04-07 09:01:29 -07:00
Ralph Little d9412740ac Merge branch 'mention-advanced-in-scanimage' into 'master'
scanimage: mention when an option is advanced

See merge request sane-project/backends!613
2021-04-07 03:24:46 +00:00
Ralph Little 7ce23d05e2 genesys: ensure that vector ptr is initialized 2021-04-06 08:41:41 -07:00
Klaus Kämpf c5d84e5f17 Merge branch 'digitdia4000_slide' into 'master'
Enable Slide advance on DigitDia 4000 and correct misspelling

See merge request sane-project/backends!620
2021-04-06 13:39:11 +00:00
pimvantend df34fa403a canon_lide70
approximate slope tables with formula a/(1+b*(x-c))
2021-04-04 16:15:10 +02:00
grmpl 696ccd2d7b Enable Slide on DigitDia 4000, correct misspelling 2021-04-03 18:41:06 +02:00
Povilas Kanapickas e16d023b2b Merge branch 'ps-devel-fix-thread-less-compile-001' into 'master'
genesys: use usleep instead of std::this_thread::sleep_for to re-enable thread less compile

See merge request sane-project/backends!619
2021-03-31 23:54:18 +00:00
Peter Seiderer 691d774f75 genesys: use usleep instead of std::this_thread::sleep_for to re-enable thread less compile
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>
2021-03-31 22:57:48 +02:00
Ordissimo eb702d33c4 Merge branch 'fix-escl-resolution-with-jpeg' into 'master'
Fix scan all resolution with JPEG.

See merge request sane-project/backends!617
2021-03-31 16:12:51 +00:00
Ordissimo de5b27c995 Merge branch 'add-escl-models' into 'master'
Add models Canon TR455X

See merge request sane-project/backends!618
2021-03-31 16:11:24 +00:00
thierry1970 9539027f24 Add models Canon TR455X 2021-03-31 17:47:16 +02:00
Thierry HUCHARD f99687b3cc Fix scan all resolution with JPEG. 2021-03-31 17:35:40 +02:00
Povilas Kanapickas 69df00d00c Merge branch 'restore_plustek_opticfilm_v2' into 'master'
genesys: add back Plustek Optifilm 7200 V2 config.

See merge request sane-project/backends!612
2021-03-30 16:00:15 +00:00
Andrew Sayers a6ffa6c8f8 scanimage: mention when an option is advanced 2021-03-30 11:51:21 +01:00
Ralph Little 0bbbf85528 genesys: add back Plustek Optifilm 7200 V2 config.
This has support in the backend and user reports works. I think this
might just be an oversight.
2021-03-28 21:07:21 -07:00
pimvantend 0ef485d189 lide70: more white balance, less slope tables 2021-03-25 13:55:13 +01:00
Ralph Little 1d30150c3c Merge branch 'epson2/disable_focus_properly' into 'master'
epson2: disable focus properly

See merge request sane-project/backends!604
2021-03-20 16:51:18 +00:00
Ralph Little 82117153f5 Merge branch 'epson2/fix-descs' into 'master'
epson2: improve descs

See merge request sane-project/backends!606
2021-03-20 16:46:52 +00:00
Ralph Little bb90aa9d95 Merge branch '454-hp-scanjet-4200c-backend-causes-segmentation-violation' into 'master'
Resolve "HP ScanJet 4200C backend causes segmentation violation"

Closes #454

See merge request sane-project/backends!607
2021-03-14 18:41:17 +00:00
Ralph Little acc5ca499f hp4200: memset incorrectly sized. registro[0] is pointer not int. 2021-03-13 17:05:13 -08:00
Wolfram Sang 39ced55454 epson2: 12000XL and 1640SU have been tested with TPU
So we can mark them as "complete" now.
2021-03-12 20:32:46 +01:00
Wolfram Sang 6e85a57e64 epson2: remove desc entries which are supported by other backends
Only the epson2.desc has entries pointing to other backends. Remove them
and update the backends which really support them instead.
2021-03-12 20:26:17 +01:00
Wolfram Sang a696443555 epson2: remove double semicolon 2021-03-04 20:54:31 +01:00
Wolfram Sang 85d8047601 epson2: bail out if device is still initializing
The comment says it all.
2021-03-04 20:54:31 +01:00
Wolfram Sang c70426fde2 epson2: use longer USB timeout
With my 12000XL, using autofocus takes ~35 sec before scanning starts.
So, extend the default USB timeout.
2021-03-04 20:54:31 +01:00
Wolfram Sang 580c278dca epson2: disable focus properly
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!
2021-03-04 08:30:46 +01:00
m. allan noah 5819a79ab0 canon_dr v62b
- 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)
2021-02-28 21:28:59 -05:00
m. allan noah 6d990e73e9 canon_dr v62a
- allow config file to set inq and vpd lengths for DR-M1060 (#263)
2021-02-28 21:28:59 -05:00
pimvantend e55ea7c06d added lide 600 to central manpage 2021-02-24 14:01:10 +01:00
Ralph Little dd9d90223e Merge branch '433-issues-in-sane-man-pages' into 'master'
Resolve "Issues in SANE man pages"

Closes #433

See merge request sane-project/backends!598
2021-02-24 02:16:05 +00:00
Ralph Little b9edb46542 doc: final corrections indicated by translators. 2021-02-23 18:00:18 -08:00
Ralph Little 44a085d685 Merge branch 'debug-minolta-dimage-scan-dual-ii' into 'master'
Add function to debug avision command

See merge request sane-project/backends!595
2021-02-24 01:21:13 +00:00
pimvantend 12c81e2f19 some color and geometry changes 2021-02-23 14:28:56 +01: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
Ralph Little 7413e3131b doc: some small man page corrections. 2021-02-21 09:01:26 -08:00
Olaf Meeuwissen 13d1cb694e Merge branch 'update-release-documentation' into 'master'
Update release documentation

See merge request sane-project/backends!596
2021-02-16 11:49:48 +00:00
Olaf Meeuwissen 5d749ac796
doc: Update the release procedure and convert to Markdown 2021-02-16 20:32:47 +09:00
Olaf Meeuwissen 7ac30dced0
NEWS: Add placeholder for user-visible changes in the next release 2021-02-16 19:46:57 +09:00
Olaf Meeuwissen 00df971593 Merge branch 'release/1.0.32' into 'master'
Release/1.0.32

Closes #122 and #248

See merge request sane-project/backends!594
2021-02-14 12:24:09 +00:00
m. allan noah c85185bd41 update AUTHORS for kvs* backends (#59) 2021-02-13 21:08:40 -05:00
m. allan noah 7dbfccb532 canon_dr backend v61
- treat DR-P208 like P-208 (#356)
- treat DR-P215 like P-215 (#356)
- adjust wait_scanner to try one TUR with a long timeout (#142)
2021-02-13 15:15:09 -05:00
m. allan noah 5205d1d09d Various fujitsu and canon_dr doc updates
- update the copyright dates
- update dates and version numbers in man pages
- add iX1600 to supported list
- set duplex-offset for P-208
2021-02-13 14:00:47 -05:00
Ralph Little b1a2b5fdb6 Merge branch '438-hp-scanjet-3400c-incorrect-maximum-scan-area' into 'master'
Resolve "HP ScanJet 3400C incorrect maximum scan area"

Closes #438

See merge request sane-project/backends!590
2021-02-12 03:11:27 +00:00
Ralph Little 23a4c86b32 niash: increased the maximum Y extent to 297mm
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.
2021-02-11 18:54:24 -08:00
Ordissimo 678495f596 Merge branch 'escl-fix-header-hp' into 'master'
Use header to activate hack localhost.

See merge request sane-project/backends!583
2021-01-31 15:18:09 +00:00
Thierry HUCHARD 5f2209ffd9 Use header to activate hack localhost. 2021-01-30 20:32:00 +01:00
Timo Teräs baa26ffd95 pixma: fix broadcast_sa size calculation
The sa_size was incorrectly used on the destination buffer which
likely contains wrong address family.

Fixes #426
2021-01-15 16:49:52 +02:00
Ralph Little 3bbf104ea0 genesys: Corrected motor slope for LiDE 120 2020-05-02 11:12:22 -07:00
494 zmienionych plików z 80088 dodań i 31643 usunięć

Wyświetl plik

@ -6,7 +6,8 @@
# Your editor may need a plugin for this configuration to take effect.
# See http://editorconfig.org/#download for details.
root = true ; look no further
; look no further
root = true
[*]
charset = utf-8

4
.gitignore vendored
Wyświetl plik

@ -58,3 +58,7 @@ test-suite.log
# `make dist` artifacts
/sane-backends-*.tar.gz
# editor temp files
*~
\#*\#

Wyświetl plik

@ -19,7 +19,7 @@ stages:
# Debian GNU/Linux.
make-dist:
image: $REGISTRY_HUB:debian-buster-mini
image: $REGISTRY_HUB:debian-bullseye-mini
stage: tarball
script:
- git ls-files | xargs ./tools/style-check.sh
@ -38,29 +38,29 @@ make-dist:
- mkdir build
- cd build
- tar xzf ../sane-backends-*.tar.gz --strip-components=1
- ./configure $CONFIGURE_OPTS
- make -j2 -k $MAKE_FLAGS
- (set -x; ./configure $CONFIGURE_OPTS)
- eval "(set -x; make -j2 -k $MAKE_FLAGS)"
debian-9-full:
image: $REGISTRY_HUB:debian-stretch-full
debian-10-full:
image: $REGISTRY_HUB:debian-buster-full
variables:
CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL"
MAKE_FLAGS: "CFLAGS=-Werror CXXFLAGS=-Werror"
<<: *compile_definition
debian-10-mini:
image: $REGISTRY_HUB:debian-buster-mini
debian-11-mini:
image: $REGISTRY_HUB:debian-bullseye-mini
variables:
CONFIGURE_OPTS: "$CONFIGURE_MINI"
MAKE_FLAGS: "CFLAGS=-Werror"
MAKE_FLAGS: "CFLAGS=-Werror CXXFLAGS=-Werror"
<<: *compile_definition
# In addition to the regular compile check, the full Debian stable
# environment is used to keep some of the HTML documentation that's
# available from our website up-to-date.
debian-10-full:
image: $REGISTRY_HUB:debian-buster-full
debian-11-full:
image: $REGISTRY_HUB:debian-bullseye-full
variables:
CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL"
MAKE_FLAGS: "CFLAGS=-Werror CXXFLAGS=-Werror"
@ -76,20 +76,22 @@ debian-10-full:
- doc/sanei-html
expire_in: 1 day
fedora-33-clang:
image: $REGISTRY_HUB:fedora-33-clang
fedora-36-clang:
image: $REGISTRY_HUB:fedora-36-clang
variables:
CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL"
MAKE_FLAGS: "CFLAGS=-Werror CXXFLAGS=-Werror"
<<: *compile_definition
alpine-3.13-musl:
image: $REGISTRY_HUB:alpine-3.13-musl
alpine-3.15-musl:
image: $REGISTRY_HUB:alpine-3.15-musl
variables:
CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL"
MAKE_FLAGS: "CFLAGS='-Werror -Wno-pedantic' CXXFLAGS=-Werror"
<<: *compile_definition
ubuntu-16.04-lts:
image: $REGISTRY_HUB:ubuntu-xenial-dist
ubuntu-22.04-lts:
image: $REGISTRY_HUB:ubuntu-jammy-dist
variables:
CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL"
MAKE_FLAGS: "CFLAGS=-Werror CXXFLAGS=-Werror"
@ -107,10 +109,10 @@ ubuntu-16.04-lts:
# hence the dependency.
make-distcheck:
image: $REGISTRY_HUB:debian-buster-full
image: $REGISTRY_HUB:debian-bullseye-full
stage: snapshot
dependencies:
- debian-10-full
- debian-11-full
script:
- tar xzf sane-backends-*.tar.gz --strip-components=1
- rm sane-backends-*.tar.gz

17
AUTHORS
Wyświetl plik

@ -24,10 +24,10 @@ Backends:
dc240: Peter Fales
dell1600n_net: Jon Chambers
dll: David Mosberger
dmc: David F. Skoll
dmc: Dianne Skoll
epjitsu: m. allan noah (*)
epson: Karl Heinz Kremer
epson2: Alessandro Zummo
epson2: Alessandro Zummo, Wolfram Sang (*)
epsonds: Alessandro Zummo
escl: Touboul Nathane, Thierry HUCHARD (*)
fujitsu: Randolph Bentson, Frederik Ramm, Oliver Schirrmeister,
@ -51,11 +51,12 @@ Backends:
ibm: M.F., Henning Geinitz
kodak: m. allan noah (*)
kodakaio: Paul Newall (*)
kvs1025: Tao Zhang, m. allan noah (*)
kvs20xx: unknown, m. allan noah (*)
kvs40xx: unknown, m. allan noah (*)
kvs1025: Tao Zhang
kvs20xx: Panasonic Russia Ltd
kvs40xx: Panasonic Russia Ltd
leo: Frank Zago
lexmark: Fred Odendaal, Stéphane Voltz
lexmark_x2600: Benoit Juin
ma1509: Henning Geinitz
magicolor: Reinhold Kainhofer(based on epson2 backend)
matsushita: Frank Zago
@ -77,7 +78,7 @@ Backends:
Nicolas Martin
Louis Lagendijk (*)
Dennis Lou
Rolf Bensch (*)
Rolf Bensch
Povilas Kanapickas (*)
plustek: Gerhard Jaeger (*)
plustek_pp: Rick Bronson (former pp driver-code), Gerhard Jaeger (*)
@ -158,6 +159,7 @@ Andreas Czechanowski <m075@ins.uni-stuttgart.de>
Andreas Nowack <nowack.andreas@gmx.de>
Andreas Rick <andreas.rick@free.fr>
Andrew Kuchling <amk@magnet.com>
Benoit Juin <benoit.juin@gmail.com>
Bernd Schroeder <bernd@aquila.muc.de>
Bertrik Sikken <bertrik@zonnet.nl>
Brian J. Murrell <brian@interlinx.bc.ca>
@ -165,10 +167,10 @@ Chris Bagwell <cbagwell-guest@users.alioth.debian.org>
Chris Pinkham <cpinkham@corp.infi.net>
Christian Bucher <cbucher@vernetzt.at>
David Etherton <etherton@netcom.com>
David F. Skoll <dskoll@iname.com>
David Huggins-Daines <bn711@freenet.carleton.ca>
David Mosberger <David.Mosberger@acm.org>
David Stevenson <david.stevenson@zoom.co.uk>
Dianne Skoll <dianne@skoll.ca>
Didier Carlier <didier@sema.be>
Earle F. Philhower III <earle@ziplabel.com>
Eddy De Greef <eddy_de_greef at scarlet dot be>
@ -257,4 +259,5 @@ Troy Rollo <sane@troy.rollo.name>
Ullrich Sigwanz <usigwanz@freesurf.ch>
Ulrich Deiters <ukd@xenon.pc.Uni-Koeln.DE>
Wittawat Yamwong <wittawat@web.de>
Wolfram Sang <wsa@kernel.org>
m. allan noah <kitno455 at gmail dot com>

Wyświetl plik

@ -419,7 +419,7 @@
1998-05-22 David Mosberger-Tang <David.Mosberger@acm.org>
* backend/dmc.c: Updated with David Skoll's latest patch.
* backend/dmc.c: Updated with Dianne Skoll's latest patch.
* sanei/sanei_scsi.c (sanei_scsi_find_devices): Declare missing
findtype arg for dummy sanei_scsi_find_devices().
@ -675,7 +675,7 @@
blocking mode, *len==0 implies end of scan).
* frontend/xscanimage.c: Ditto.
* doc/sane-dmc.man: New file by David Skoll.
* doc/sane-dmc.man: New file by Dianne Skoll.
* sanei/sanei_DomainOS.c: New file by Paul Walker.
@ -806,8 +806,8 @@
* doc/Makefile.in (SECT5): Ditto.
* backend/dmc.c, backend/dmc.h: Update with Feb 26 patch from
David Skoll.
* doc/dmc.man: New file by David Skoll.
Dianne Skoll.
* doc/dmc.man: New file by Dianne Skoll.
1998-02-25 David Mosberger-Tang <David.Mosberger@acm.org>
@ -862,8 +862,8 @@
* backend/coolscan-scsidef.h: Ditto.
* backend/coolscan.h: Ditto.
* backend/hp.c (sane_close): Change s to s->next (patch by David
Skoll <dskoll@chipworks.com>).
* backend/hp.c (sane_close): Change s to s->next (patch by Dianne
Skoll <dianne@skoll.ca>).
1998-02-17 David Mosberger-Tang <David.Mosberger@acm.org>

Wyświetl plik

@ -163,7 +163,7 @@
* frontend/saned.c (DBG): Remove extraneous parens around "msg".
* AUTHORS (Frontends): Update David Skoll's email address.
* AUTHORS (Frontends): Update Dianne Skoll's email address.
* frontend/saned.c (get_free_handle): Check for out of memory
situations and initialize newly allocated memory.

Plik diff jest za duży Load Diff

Wyświetl plik

@ -0,0 +1,196 @@
commit d5187355f6e0de529b562569509a1851dda7ad84
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-05-17 20:16:28 +0900
NEWS: Document changes for 1.0.30 release
commit 1fe94e6674d0572d2408361903730f012c60fc6c
Merge: 898ab1834864 5104b80fc8f0
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-05-17 16:26:00 +0900
Merge branch '279-confidential-issue' into release/1.0.30
commit 5104b80fc8f0d6528b856233a52846a414ae6616
Merge: f38c9f0d64a5 30b1831a28f2
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-05-14 09:36:25 +0000
Merge branch 'mitigate-epsonds-net-security-issue' into '279-confidential-issue'
epsonds: Mitigate potential network related security issues. Re #279
See merge request paddy-hack/backends!9
commit 30b1831a28f24ab2921b9f717c66d37f02bb81cc
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-05-11 21:07:12 +0900
epsonds: Mitigate potential network related security issues. Re #279
This pre-empts the possibility of triggering GHSL-2020-079, GHSL-2020-080
and GHSL-2020-081.
commit f38c9f0d64a52697562abdfbf9c9044cb1b7e897
Merge: 3d005c2570a7 b9b0173409df
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-05-07 09:42:42 +0000
Merge branch 'issue09-esci2-img-buffer-size-check' into '279-confidential-issue'
epsonds: Prevent possible buffer overflow when reading image data
See merge request paddy-hack/backends!8
commit b9b0173409df73e235da2aa0dae5edd21fb55967
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-04-27 18:48:29 +0900
epsonds: Prevent possible buffer overflow when reading image data
Addresses GHSL-2020-084, re #279.
commit 3d005c2570a71fe93a63192d9c47ee54cb39049b
Merge: 226d9c92899f 27ea994d23ee
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-05-06 04:06:49 +0000
Merge branch 'issue05-out-of-bounds-read-decode_binary' into '279-confidential-issue'
epsonds: Do not read beyond the end of the token
See merge request paddy-hack/backends!5
commit 27ea994d23ee52fe1ec1249c92ebc1080a358288
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-04-30 21:15:45 +0900
epsonds: Do not read beyond the end of the token
Addresses GHSL-2020-082, re #279.
commit 226d9c92899facf4b22b98c73be6ad2cd0effc4a
Merge: 02b5d33b7a7c db9480b09ea8
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-05-06 04:05:59 +0000
Merge branch 'issue07-out-of-bounds-read-in-esci2_check_header' into '279-confidential-issue'
epsonds: Read only up to seven hexdigits to determine payload size
See merge request paddy-hack/backends!6
commit db9480b09ea807e52029f2334769a55d4b95e45b
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-04-27 18:24:56 +0900
epsonds: Read only up to seven hexdigits to determine payload size
Addresses GHSL-2020-083, re #279.
commit 02b5d33b7a7c0b72137f5b968c46a1d52a75aa63
Merge: 4c9e4efd4a82 8682023faa27
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-05-06 04:04:18 +0000
Merge branch 'issue08-integer-overflow-sanei_tcp_read' into '279-confidential-issue'
sanei: Integer overflow sanei tcp read
See merge request paddy-hack/backends!7
commit 8682023faa27c61156a354955c89617a3304d66f
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-05-04 11:54:35 +0900
sanei_tcp: Address possible integer overflow. Re #279, issue 8
commit fe08bbee6b238ea0be73af67b560ffc2c47562fd
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-05-04 11:48:46 +0900
epsonds: Handle error condition. Re #279, issue 8
commit 4c9e4efd4a82214719eeb1377a900e3a85c1c369
Merge: 2b4aa45bad61 fff83e7eacd0
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-05-06 04:03:19 +0000
Merge branch 'issue01-null-pointer-deref-sanei_epson_net_read' into '279-confidential-issue'
epson2: Rewrite network I/O
See merge request paddy-hack/backends!3
commit fff83e7eacd0f27bb2d71c42488e0fd735c15ac3
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-04-30 18:24:51 +0900
epson2: Rewrite network I/O
This addresses GHSL-2020-075 as well as all other problematic code
uncovered as a result of investigating that. This includes:
- buffer overflows due to use of unchecked lengths
- integer overflows due to type conversions
- potential memory leaks
- checking for memory allocation failures
Re #279.
commit 2b4aa45bad61d5e34996645581a606fd8795a48c
Merge: 37b142494bf6 07e3834127f8
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-05-04 08:24:19 +0000
Merge branch 'issue11-read_of_uninitialized_data' into '279-confidential-issue'
magicolor: Added security mediation to device discovery
See merge request paddy-hack/backends!2
commit 07e3834127f8bcd9dac02b91c17127dc41fbfb5b
Author: Ralph Little <skelband@gmail.com>
Date: 2020-04-30 23:21:00 -0700
magicolor: Added security mediation to device discovery
Extraction of values from the SNMP response were not checked.
Also fixed a bug that mistakenly matched any SNMP OIDs with the
first model in the model list, in function mc_get_device_from_identification().
commit 37b142494bf659d8147b6f0fcb8629408717d14d
Merge: e52a5bf71979 af0442f15cc9
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-05-04 05:28:37 +0000
Merge branch 'issue10-SIGFPE-in-mc_setup_block_mode' into '279-confidential-issue'
magicolor: Added security remediation for pixels_per_line.
See merge request paddy-hack/backends!1
commit af0442f15cc966bbc3d7d9322380005ea0ee8340
Author: Ralph Little <skelband@gmail.com>
Date: 2020-04-26 13:04:41 -0700
magicolor: Added security remediation for pixels_per_line.
This implements a security issue reported by GitHub Security Lab.
The details are disclosed in GitLab issue #279.
The issue relates to an invalid scan parameter block being sent to
the backend containing 8 bytes of 0x00 which leads to pixels_per_line
being set to 0. Later arithmetic involves the division by this value
which causes a div by zero crash.
commit 898ab1834864e3b813f0d0ae234f38ac05813756
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-02-06 20:56:21 +0900
Really remove libxml2 linker/loader flags from dependencies. Re #239
commit 76bf742aba32ec1ed4ae641285f8e6a0b038326d
Author: Olaf Meeuwissen <paddy-hack@member.fsf.org>
Date: 2020-02-05 21:30:11 +0900
Remove libxml2 linker/loader flags from dependencies. Re #239

Plik diff jest za duży Load Diff

Plik diff jest za duży Load Diff

Plik diff jest za duży Load Diff

Plik diff jest za duży Load Diff

287
NEWS
Wyświetl plik

@ -1,5 +1,290 @@
<!-- -*- Mode: markdown -*- -->
<!-- Please add new release notes to the newsfragments directory (read the README.md file there).
The release notes will be collected at release time and put into this document
semi-automatically.
-->
<!--(towncrier release notes start)-->
## New with 1.3.1 (released 2024-05-22)
### Backends
- `avision`:
- Correction for ADF presence detect which caused a hang.
- Internationalised some text items in the backend to make them available for translation.
- `epsonds`:
- Some small changes to option documentation.
- Added support for models: ES-C220, DS-C330, and DS-C490.
- `escl`:
- Fix for pwf:Version item.
- Fix for crash in libjpeg when cropping image.
- Fix for issue with configured device when AVAHI not running.
- Fix for build without poppler-glib.
- `fujitsu`:
- Added support for Ricoh scanners: FI-8040, FI-70F.
- `genesys`:
- Added missing configuration for Plustek OpticFilm 7500i and Plustek OpticFilm 8100.
- `hpljm1005`:
- Fixes to maximum geometries and various cropping and geometry details specifically for the HP LaserJet M1005.
- `lexmark_X2670`:
- Added new backend for the Lexmark X26xx series of scanners.
- `pixma`:
- Fix to prevent mode change when source is selected. Mode should not change if still valid for source.
- Added support for models: TS8630 Series, XK110 Series, GX3000 Series, GX4000 Series, G3070 Series, G2070 Series, G4070 Series, G3030 Series, G2030 Series, TC-20M, TC-5200M, TR4500 Series, TS8700 series, XK120 series, GX1000 series, GX2000 series, TS6630 series, TS7700 series, TS7600i series, TS6730 series, TR7800 series, TS7700i series, TS7700A series, GX6500 series, i-SENSYS MF750 Series
- `snapscan`:
- Corrections for Agfa ARCUS 1200 scan area.
- `test`:
- Fix for a crash in the backend.
- `xerox_mfp`:
- Added support for Dell 1135n, which is a clone of the Samsung SCX-4623F.
- Added support for Xerox WorkCentre 3335.
- Added JPEG mitigation for modules that don't properly support JPEG output: Xerox WorkCentre 3225
- Fix to remove USB CLEAR HALT during initialisation which can potentially lock up devices.
- General fixes to support the SCX-4521F model.
### Frontends
- `saned`:
- Default scan buffer is now 1MB. -B option added to permit the buffersize to be set.
- Documentation fixes.
- `scanimage`:
- Fix for keyboard prompt processing
- Default scan buffer is now 1MB. --buffer-size and -B options now require an argument to be provided.
- Fix for PDF generation, missing newline in generated file.
### Build
- Fixes for clang-16 compiler
- Fixes for FreeBSD build.
- Fixes for escl build option involving poppler-glib.
- Optionally take build version from ChangeLog if not other version source is available.
- Fixes to autoconf files to remove unnecessary warnings from test logs.
- Fix for macOS builds related to threading support: SANE in macOS doesn't work for multi-process with libusb.
### Tools
- sane-find-scanner: Added some Linux SCSI device names since some later potential names are missing. Better solution in the pipeline.
### Documentation
- Fixes for a number of man pages.
- Added documentation for a number of Ricoh scanners which are rebranded products acquired from Fujitsu.
### Miscellaneous
- sanei_config: Fix for a potential crash.
- New Georgian translation added.
- Translations updated for: British English, Ukrainian, French and Simplified Chinese.
## New with 1.2.1 (released 2023-02-05)
### Backends
- `avision`:
- Minor fix for protocol packet length.
- Added “basic” support for Avision AD345F. Note that multi-sheet scanning is problematic.
- Fix for 32-bit limitation on scan line size which caused early abort of scan.
- Fix for minimum resolution for devices with AV_ASIC_C6.
- Various small logic errors addressed.
- `canon`: Use the common model name instead of string from the device.
- `canon_lide70`: Some small corrections to option support.
- `canon_pp`: Potential buffer overrun issue addressed.
- `canon-dr`: Added support for lifecycle counters for dr-x10c scanners.
- `epjitsu`: Hang fix for Scansnap S1300i.
- `epsonds`: Added support for Epson XP-2200 Series devices.
- `escl`:
- Fixes related to support for HP M277dw.
- Fix for Canon TS-3400 series resolution support.
- Added support for Epson EcoTank L3160.
- Fix for segfault crash.
- Performance and memory use enhancements through the use of memory-mapped I/O.
- Fix for TIFF file type generation failure.
- IPv6 detection improvements.
- `fujitsu`:
- Contrast/brightness fixes for Fujitsu ix500.
- Support confirmed for Fujitsu fi-7300NX.
- Support added for ScanSnap ix1400.
- Added support for ScanPartner SP30.
- `genesys`:
- Fixes for unit test build errors related to GCC 12.
- Fix for 32-bit limitation on scan line size which caused early abort. of scan.
- Build issue fix for OSX.
- Button support for Canon 8400f scanner corrected.
- Support added back in for Plustek OpticFilm 7600i: config file entry was missing.
- `kvs40xx`: Compiler warnings fixed.
- `mustek_usb2`: Compiler warnings fixed.
- `pixma`:
- Fix for Canon TS-3400 series resolution support.
- Button support for Canon MG5700 series corrected.
- Added support for Canon imageRUNNER 1018/1022/1023.
- Added support for Canon PIXMA TS2400 Series.
- Added support for Canon PIXMA TS2600 Series.
- Testing confirmed for Canon TS6400 series devices.
- Testing confirmed for Canon TS3400 series devices.
- Various devices max resolutions fixed.
- Minor fix for broadcast buffer size error.
- `plustek_pp`: Support removed for deprecated Linux kernel driver build.
- `test`: Fix for 32-bit limitation on scan line size which caused early abort of scan.
- `xerox_mfp`:
- JPEG support fix for Samsung SCX-4828 FN and similar.
- JPEG support fix for Samsung SCX-4824 FN and similar.
### Frontends
- `sane-find-scanner`: Alteration to output to indicate that indicated devices are potentially scanners.
- `saned`: Fix for poll.h header file, which caused problems on Alpine Linux.
- `scanimage`:
- Attempts to set readonly options will give a warning about readonly option set attempt now, instead of the misleading "unknown option" error.
- Header file build fixes for FreeBSD.
- Fix for backends presenting NULL attributes in deactivated options.
### Miscellaneous
- Updated translation to Russian, Italian, British English and Ukraine.
- Compiler warnings addressed for a number of backends.
- A number of fixes for the build system:
- Fix to ignore LDFLAGS environment variable in build.
- Fix to not build umax_pp tool when disabled.
- Fix for CLANG compiler warnings.
- Various small improvements to dependency checking and CI builds.
- General corrections for backends use of mkstemp() function.
- Added support for autotools silent build option.
- Remove –with-group configure option, since it is no longer used.
- Autotools fixes for backend library installation.
## New with 1.1.1 (released 2022-01-18)
### Backends
- `epson2`: Fixed support for many scanners that don't support focus command.
- `epson2`: Improve reliability of long scans.
- `epsonds`: Implemented support for the following Epson scanners:
- DS-1610
- DS-1630
- DS-1660W
- DS-310
- DS-320
- DS-360W
- DS-410
- DS-530
- DS-530II
- DS-531
- DS-535
- DS-535H
- DS-535II
- DS-570W
- DS-570WII
- DS-571W
- DS-575W
- DS-575WII
- DS-70
- DS-80W
- ES-200
- ES-300W
- ES-300WR
- ES-400
- ES-400II
- ES-50
- ES-500W
- ES-500WII
- ES-500WR
- ES-55R
- ES-580W
- ES-60W
- ES-60WB
- ES-60WW
- ES-65WR
- ET-2700 Series
- ET-2710 Series
- ET-2810 Series
- ET-M2140 Series
- ET-M3140 Series
- EW-052A Series
- FF-680W
- L3150 Series
- L3200 Series
- L3210 Series
- L3250 Series
- L4150 Series
- M2140 Series
- M3140 Series
- RR-60
- RR-600W
- RR-70W
- XP-2100 Series
- XP-2150 Series
- `epson2`: Marked XP-452 455 series as supported in documentation.
- `escl`: Fixed scanning problems on certain scanners due to incorrect URL being used
(https://gitlab.com/sane-project/backends/-/issues/479)
- `escl`: Fixed support for different resolutions when using JPEG format.
- `escl`: Fixed handling of ipp-usb redirects to localhost which previously caused certain scanners
to be always reported as busy.
- `escl`: Added support for Brother DCP-J772DW and Epson ET-2750 scanners.
- `escl`: Marked the following scanners as supported in documentation:
- Canon PIXMA G4511
- Canon PIXMA TR4550 Series
- Canon PIXMA TR4551 Series
- Epson ET-6100
- `escl`: Implemented support for disabling PDF output on scanners where it's broken
(https://gitlab.com/sane-project/backends/-/issues/510)
- `escl`: Implemented support for Canon PIXME TR4520 and TR7500 scanners.
- `genesys`: Improved scan quality on Canon LiDE 35/40/50/60 by using brighter LED illumination.
- `genesys`: Fixed control of contrast and brigthness on certain scanners
(https://gitlab.com/sane-project/backends/-/issues/271).
- `genesys`: Fixed crashes when handling slightly unexpected conditions
(https://gitlab.com/sane-project/backends/-/issues/464).
- `genesys`: Fixed support for Plustek Opticfilm 7200 v2 scanner.
- `genesys`: Fixed button support on HP ScanJet G4010.
- `genesys`: Fixed compilation on gcc-4.8.
- `genesys`: Fixed incorrect LED exposure calculation leading to wrong color balance on certain
resolutions on gl841 scanners
- `genesys`: Improved gray scan quality on Canon LiDE 110, 120, 210, 220
(https://gitlab.com/sane-project/backends/-/issues/106,
https://gitlab.com/sane-project/backends/-/issues/52).
- `genesys`: Fixed issue of motor becoming stuck at certain resolutions on Canon LiDE 50
and possibly other gl841 scanners (https://gitlab.com/sane-project/backends/-/issues/357)
- `genesys`: Fixed periodic black lines in gray scans on Canon LiDE 80.
- `genesys`: Removed support for broken 75 and 100 dpi hardware resolutions to fix preview
scans (https://gitlab.com/sane-project/backends/-/issues/383). These resolutions did
not have any benefit compared to next smallest 150 dpi resolution.
- `genesys`: Add support for running in embedded environments that don't support threads.
- `genesys`: Fixed gray scans to use white color for illumination instead of red on
Canon LiDE 35/40/50/60 and potentially other gl841 scanners. Old behavior can
be restored via the color filter setting to select specific color component for
the gray scan.
- `genesys`: The genesys backend is now distributed under GPL v2 or later license.
Previously there existed an exception that allowed additional uses of the backend.
- `gt68xx`: Fixed several memory issues that can potentially lead to crashes or increased memory use.
- `hp4200`: Fixed crash when using HP ScanJet 4200C
(https://gitlab.com/sane-project/backends/-/issues/454).
- `microtek`: Fixed support for embedded platforms using `uclibc`.
- `pieusb`: Implemented support for Reflecta RPS 10M scanner.
- `pieusb`: Fixed support for automatically advancing slides on DigitDia 4000.
- `pixma`: Fixed compliation with `NDEBUG` macro defined.
- `pixma`: Marked Canon PIXMA G4511 as supported in documentation
- `scangearmp2`: Mark GX6000, GX7000, TS5400 and MX455 series as supported.
- `sm3600-scanutil`: Fixed support for embedded platforms using `uclibc`.
### Frontends
- Improved documentation of `scanimage` concerning options provided by backends.
- `scanimage`: Improved help to specify which options are advanced.
- `scanimage`: Implemented support for PDF output format.
### Miscellaneous
- Added translation to Simplified Chinese.
## New with 1.0.32 (released 2021-02-14)
### Backends
@ -1102,7 +1387,7 @@ There is now support for the SnapScan 310 and 600 scanner models.
New with 0.71:
* Polaroid Digital Microscope Camera (DMC) backend
Written by David Skoll <dskoll@chipworks.com>.
Written by Dianne Skoll <dianne@skoll.ca>
* Apple scanner backend
Written by Milon Firikis <milonf@isosun.ariadne-t.gr>. This backend

Wyświetl plik

@ -1,5 +1,3 @@
Last update: 2006-01-05
- Avoiding damage on flatbed scanners
Most flatbed scanners have no protection against exceeding the physical scan
@ -15,8 +13,10 @@ Last update: 2006-01-05
- Security problems with saned (SANE network scanning daemon)
saned is not intended to be exposed to the internet or other non-trusted
networks. Make sure that access is limited by tcpwrappers and/or a firewall
setup. Don't depend only on saned's own authentication. Don't run saned
as root if it's not necessary. And do not install saned as setuid root.
Read man saned(8) for details.
saned does not provide confidentiality when communicating with clients.
If saned is exposed directly on the network, other users may be able to
intercept scanned images, or learn passwords for connecting to saned,
with little effort. Client systems should connect to saned through a
secure tunnel to the server instead.
saned is not a trusted program and should not run with root privileges.

2
README
Wyświetl plik

@ -38,7 +38,7 @@ Ubuntu PPA https://launchpad.net/~sane-project/+archive/ubuntu/sane-release
sudo add-apt-repository ppa:sane-project/sane-release
sudo apt update
apt install libsane libsane-common sane-utils
sudo apt install libsane libsane-common sane-utils
Prerequisites

Wyświetl plik

@ -248,8 +248,16 @@ AC_DEFUN([SANE_CHECK_PTHREAD],
AC_DEFINE(PTHREAD_T_IS_INTEGER, 1,
[Define if pthread_t is integer.])
else
# Until the sanei_thread implementation is fixed.
use_pthread=no
case "$host_os" in
darwin*)
# Always use pthreads on macOS
use_pthread=yes
;;
*)
# Until the sanei_thread implementation is fixed.
use_pthread=no
;;
esac
fi
if test "$have_pthread" = "yes" ; then
@ -322,10 +330,9 @@ AC_DEFUN([SANE_CHECK_PNG],
])
#
# Checks for pthread support
# Checks for device locking support
AC_DEFUN([SANE_CHECK_LOCKING],
[
LOCKPATH_GROUP=uucp
use_locking=yes
case "${host_os}" in
os2* )
@ -345,23 +352,6 @@ AC_DEFUN([SANE_CHECK_LOCKING],
use_locking=no
fi
])
if test $use_locking = yes ; then
AC_ARG_WITH([group],
AS_HELP_STRING([--with-group],
[use the specified group for lock dir @<:@default=uucp@:>@]),
[LOCKPATH_GROUP="$withval"]
)
# check if the group does exist
lasterror=""
touch sanetest.file
chgrp $LOCKPATH_GROUP sanetest.file 2>/dev/null || lasterror=$?
rm -f sanetest.file
if test ! -z "$lasterror"; then
AC_MSG_WARN([Group $LOCKPATH_GROUP does not exist on this system.])
AC_MSG_WARN([Locking feature will be disabled.])
use_locking=no
fi
fi
if test $use_locking = yes ; then
INSTALL_LOCKPATH=install-lockpath
AC_DEFINE([ENABLE_LOCKING], 1,
@ -371,11 +361,7 @@ AC_DEFUN([SANE_CHECK_LOCKING],
fi
AC_MSG_CHECKING([whether to enable device locking])
AC_MSG_RESULT([$use_locking])
if test $use_locking = yes ; then
AC_MSG_NOTICE([Setting lockdir group to $LOCKPATH_GROUP])
fi
AC_SUBST(INSTALL_LOCKPATH)
AC_SUBST(LOCKPATH_GROUP)
])
dnl
@ -493,6 +479,7 @@ AC_DEFUN([SANE_CHECK_IPV6],
if test "$ipv6" != "no" ; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define INET6
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h> ]], [[
/* AF_INET6 available check */
@ -514,6 +501,7 @@ AC_DEFUN([SANE_CHECK_IPV6],
AC_MSG_CHECKING([whether struct sockaddr_storage has an ss_family member])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define INET6
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h> ]], [[
/* test if the ss_family member exists in struct sockaddr_storage */
@ -526,6 +514,7 @@ AC_DEFUN([SANE_CHECK_IPV6],
], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define INET6
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h> ]], [[
/* test if the __ss_family member exists in struct sockaddr_storage */

Wyświetl plik

@ -2,6 +2,20 @@
test -n "$srcdir" || srcdir=`dirname "$0"`
test -n "$srcdir" || srcdir=.
# When repos are forked on GitLab tags aren't copied thus making
# git-version-gen producing incorrect version ("UNKNOWN") which in turn causes
# CI build failures. To workaround this 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.
if [ ! -e .tarball-version ] &&
! git describe >/dev/null 2>&1; then
ls ChangeLogs \
| sort -Vr \
| grep -m1 -P -o '(?<=ChangeLog-).*' > .tarball-version
read v < .tarball-version
echo >&2 "Package version reconstructed from ChangeLog: $v"
fi
patchdir="$srcdir/patches"
# Suppress warnings about obsolete macros if still needed (#122)

Plik diff jest za duży Load Diff

Wyświetl plik

@ -236,8 +236,8 @@ wait_ready (int fd)
static SANE_Status
sense_handler (int scsi_fd, u_char * result, void *arg)
{
scsi_fd = scsi_fd; /* silence gcc */
arg = arg; /* silence gcc */
(void) scsi_fd; /* silence gcc */
(void) arg; /* silence gcc */
switch (result[2] & 0x0F)
{
@ -850,12 +850,12 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
size_t len;
FILE *fp;
authorize = authorize; /* silence gcc */
(void) authorize; /* silence gcc */
DBG_INIT ();
if (version_code)
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
fp = sanei_config_open (ABATON_CONFIG_FILE);
if (!fp)
@ -915,7 +915,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
Abaton_Device *dev;
int i;
local_only = local_only; /* silence gcc */
(void) local_only; /* silence gcc */
if (devlist)
free (devlist);
@ -1399,7 +1399,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len,
status = sanei_scsi_cmd (s->fd, test_unit_ready,
sizeof (test_unit_ready), 0, 0);
if (status != SANE_STATUS_GOOD || status != SANE_STATUS_INVAL)
if (status != SANE_STATUS_GOOD && status != SANE_STATUS_INVAL)
return status;
return SANE_STATUS_CANCELLED;
}
@ -1472,8 +1472,8 @@ sane_cancel (SANE_Handle handle)
SANE_Status
sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
{
handle = handle; /* silence gcc */
non_blocking = non_blocking; /* silence gcc */
(void) handle; /* silence gcc */
(void) non_blocking; /* silence gcc */
DBG (FLOW_CONTROL, "sane_set_io_mode: Don't call me please. "
"Unimplemented function\n");
@ -1483,8 +1483,8 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
{
handle = handle; /* silence gcc */
fd = fd; /* silence gcc */
(void) handle; /* silence gcc */
(void) fd; /* silence gcc */
DBG (FLOW_CONTROL, "sane_get_select_fd: Don't call me please. "
"Unimplemented function\n");

Wyświetl plik

@ -236,8 +236,8 @@ test_ready (int fd)
static SANE_Status
sense_handler (int scsi_fd, u_char *result, void *arg)
{
scsi_fd = scsi_fd; /* silence gcc */
arg = arg; /* silence gcc */
(void) scsi_fd; /* silence gcc */
(void) arg; /* silence gcc */
if (result[0])
{
@ -253,7 +253,7 @@ sense_handler (int scsi_fd, u_char *result, void *arg)
static SANE_Status
stop_scan (int fd)
{
fd = fd; /* silence gcc */
(void) fd; /* silence gcc */
/* XXX don't know how to stop the scanner. To be tested ! */
#if 0
@ -1280,14 +1280,14 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
size_t len;
FILE *fp;
authorize = authorize; /* silence gcc */
(void) authorize; /* silence gcc */
DBG_INIT ();
sanei_thread_init ();
if (version_code)
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
fp = sanei_config_open ("agfafocus.conf");
if (!fp)
@ -1335,7 +1335,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
AgfaFocus_Device *dev;
int i;
local_only = local_only; /* silence gcc */
(void) local_only; /* silence gcc */
if (devlist)
free (devlist);

Wyświetl plik

@ -328,8 +328,8 @@ return SANE_STATUS_GOOD;
static SANE_Status
sense_handler (int scsi_fd, u_char * result, void *arg)
{
scsi_fd = scsi_fd; /* silence gcc */
arg = arg; /* silence gcc */
(void) scsi_fd; /* silence gcc */
(void) arg; /* silence gcc */
switch (result[2] & 0x0F)
{
@ -1866,12 +1866,12 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
size_t len;
FILE *fp;
authorize = authorize; /* silence gcc */
(void) authorize; /* silence gcc */
DBG_INIT ();
if (version_code)
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
fp = sanei_config_open (APPLE_CONFIG_FILE);
if (!fp)
@ -1930,7 +1930,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
Apple_Device *dev;
int i;
local_only = local_only; /* silence gcc */
(void) local_only; /* silence gcc */
if (devlist)
free (devlist);
@ -2667,7 +2667,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
{
DBG (FLOW_CONTROL,"sane_set_io_mode: Entering.\n");
handle = handle; /* silence gcc */
(void) handle; /* silence gcc */
if (non_blocking)
{
@ -2682,8 +2682,8 @@ return SANE_STATUS_GOOD;
SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
{
handle = handle; /* silence gcc */
fd = fd; /* silence gcc */
(void) handle; /* silence gcc */
(void) fd; /* silence gcc */
DBG (FLOW_CONTROL, "sane_get_select_fd: Don't call me please. "
"Unimplemented function\n");

Wyświetl plik

@ -2591,7 +2591,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
strcpy (artec_model, "");
if (version_code)
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
if (authorize)
DBG (7, "sane_init(), authorize %s null\n", (authorize) ? "!=" : "==");
@ -3474,7 +3474,7 @@ artec_sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int
SANE_Byte line_buf[ARTEC_MAX_READ_SIZE];
DBG (7, "artec_sane_read( %p, %p, %d, %d )\n", handle, buf, max_len, *len);
DBG (7, "artec_sane_read( %p, %p, %d, %d )\n", handle, (void *) buf, max_len, *len);
*len = 0;
@ -3674,7 +3674,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len
static SANE_Byte temp_buf[ARTEC_MAX_READ_SIZE];
static int bytes_in_buf = 0;
DBG (7, "sane_read( %p, %p, %d, %d )\n", handle, buf, max_len, *len);
DBG (7, "sane_read( %p, %p, %d, %d )\n", handle, (void *) buf, max_len, *len);
DBG (9, "sane_read: bib = %d, ml = %d\n", bytes_in_buf, max_len);
if (bytes_in_buf != 0)

Wyświetl plik

@ -351,9 +351,6 @@ static void
finish_shading_buffer (Artec48U_Scanner * s, SANE_Bool white)
{
unsigned int i, j, cnt, c, div;
unsigned long max_r;
unsigned long max_g;
unsigned long max_b;
unsigned char *shading_buffer;
cnt = 0;
@ -379,18 +376,12 @@ finish_shading_buffer (Artec48U_Scanner * s, SANE_Bool white)
++cnt;
}
}
max_r = 0;
max_g = 0;
max_b = 0;
for (c = 0; c < (30720 * s->dev->epro_mult) - 5; c += 6) /*epro*/
{
i = (int) shading_buffer[c] + ((int) shading_buffer[c + 1] << 8);
max_r += i;
i = (int) shading_buffer[c + 2] + ((int) shading_buffer[c + 3] << 8);
max_g += i;
i = (int) shading_buffer[c + 4] + ((int) shading_buffer[c + 5] << 8);
max_b += i;
}
}
@ -1628,7 +1619,7 @@ artec48u_device_memory_read (Artec48U_Device * dev,
SANE_Status status;
XDBG ((8, "%s: dev=%p, addr=0x%x, size=0x%x, data=%p\n",
function_name, (void *) dev, addr, size, data));
function_name, (void *) dev, addr, size, (void *) data));
CHECK_DEV_ACTIVE (dev, function_name);
status = sanei_usb_control_msg (dev->fd, 0xc0, 0x01,
@ -4458,7 +4449,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
auth = authorize;
if (version_code != NULL)
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
fp = sanei_config_open (ARTEC48U_CONFIG_FILE);

Wyświetl plik

@ -626,7 +626,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
DBG_INIT ();
DBG (2, "sane_init (authorize %s null)\n", (authorize) ? "!=" : "==");
if (version_code)
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
/* fp = sanei_config_open (AS6E_CONFIG_FILE);*/
if (!fp)
{

Plik diff jest za duży Load Diff

Wyświetl plik

@ -66,6 +66,65 @@ typedef enum Avision_ConnectionType {
AV_USB
} Avision_ConnectionType;
/*
* Translatable custom options text.
*
*/
#define SANE_TITLE_MISC_GROUP SANE_I18N("Miscellaneous")
#define SANE_TITLE_INSTALLED_OPTS_GROUP SANE_I18N("Installed options")
#define SANE_TITLE_OVERSCAN_TOP SANE_I18N("Overscan top")
#define SANE_TITLE_OVERSCAN_BOTTOM SANE_I18N("Overscan bottom")
#define SANE_TITLE_BACKGROUND_LINES SANE_I18N("Background raster lines")
#define SANE_TITLE_QUALITY_SCAN SANE_I18N("Quality scan")
#define SANE_TITLE_MANUAL_EXPOSURE SANE_I18N("Exposure")
#define SANE_TITLE_MULTI_SAMPLE SANE_I18N("Multi-sample")
#define SANE_TITLE_POWER_SAVE_TIME SANE_I18N("Power save timer control")
#define SANE_TITLE_OPTIONS_MSG SANE_I18N("Message text from the scanner")
#define SANE_TITLE_NVRAM SANE_I18N("Obtain NVRAM values")
#define SANE_TITLE_PAPER_LENGTH SANE_I18N("Use paper length")
#define SANE_TITLE_FLIP_PAGE SANE_I18N("Flip document after duplex scanning")
#define SANE_TITLE_ADF_INSTALLED SANE_I18N("ADF installed")
#define SANE_TITLE_LIGHTBOX_INSTALLED SANE_I18N("Lightbox installed")
#define SANE_DESC_OVERSCAN_TOP \
SANE_I18N("The top overscan controls the additional area to scan before the "\
"paper is detected.")
#define SANE_DESC_OVERSCAN_BOTTOM \
SANE_I18N("The bottom overscan controls the additional area to scan after "\
"the paper end is detected.")
#define SANE_DESC_BACKGROUND_LINES \
SANE_I18N("The background raster controls the additional background lines to "\
"scan before the paper is feed through the scanner.")
#define SANE_DESC_QUALITY_SCAN \
SANE_I18N("Turn on quality scanning (slower but better).")
#define SANE_DESC_MANUAL_EXPOSURE \
SANE_I18N("Manual exposure adjustment.")
#define SANE_DESC_MULTI_SAMPLE \
SANE_I18N("Enable multi-sample scan mode.")
#define SANE_DESC_POWER_SAVE_TIME \
SANE_I18N("Allows control of the scanner's power save timer, dimming or "\
"turning off the light.")
#define SANE_DESC_OPTIONS_MSG \
SANE_I18N("This text contains device specific options controlled by the "\
"user on the scanner hardware.")
#define SANE_DESC_NVRAM \
SANE_I18N("Allows access obtaining the scanner's NVRAM values as pretty "\
"printed text.")
#define SANE_DESC_PAPER_LENGTH \
SANE_I18N("Newer scanners can utilize this paper length to detect double feeds. "\
"However some others (DM152) can get confused during media flush if it is set.")
#define SANE_DESC_FLIP_PAGE \
SANE_I18N("Tells page-flipping document scanners to flip the paper back to its "\
"original orientation before dropping it in the output tray. "\
"Turning this off might make scanning a little faster if you don't "\
"care about manually flipping the pages afterwards.")
#define SANE_DESC_ADF_INSTALLED \
SANE_I18N("ADF option is detected as installed.")
#define SANE_DESC_LIGHTBOX_INSTALLED \
SANE_I18N("Lightbox option is detected as installed.")
/* information needed for device access */
typedef struct Avision_Connection {
Avision_ConnectionType connection_type;
@ -336,6 +395,10 @@ enum Avision_Option
OPT_PAPERLEN, /* Use paper_length field to detect double feeds */
OPT_ADF_FLIP, /* For flipping duplex, reflip the document */
OPT_OPTIONS_GROUP,
OPT_OPTION_ADF, // ADF installed/detected?
OPT_OPTION_LIGHTBOX, // LightBox installed/detected?
NUM_OPTIONS /* must come last */
};
@ -398,8 +461,7 @@ typedef struct Avision_Device
SANE_Bool inquiry_nvram_read;
SANE_Bool inquiry_power_save_time;
SANE_Bool inquiry_light_box;
SANE_Bool inquiry_adf;
SANE_Bool inquiry_adf_capability;
SANE_Bool inquiry_duplex;
SANE_Bool inquiry_duplex_interlaced;
SANE_Bool inquiry_paper_length;
@ -419,6 +481,10 @@ typedef struct Avision_Device
SANE_Bool inquiry_light_control;
SANE_Bool inquiry_exposure_control;
// Determines from accessories query.
SANE_Bool inquiry_light_box_present;
SANE_Bool inquiry_adf_present;
int inquiry_max_shading_target;
SANE_Bool inquiry_button_control;
unsigned int inquiry_buttons;
@ -502,7 +568,6 @@ typedef struct Avision_Scanner
/* Internal data for duplex scans */
char duplex_rear_fname [PATH_MAX];
char duplex_offtmp_fname [PATH_MAX];
SANE_Bool duplex_rear_valid;
color_mode c_mode;
@ -795,17 +860,17 @@ typedef struct acceleration_info
/* set/get SCSI highended (big-endian) variables. Declare them as an array
* of chars endianness-safe, int-size safe ... */
#define set_double(var,val) var[0] = ((val) >> 8) & 0xff; \
var[1] = ((val) ) & 0xff
#define set_double(var,val) var[0] = (uint8_t) (((val) >> 8) & 0xff); \
var[1] = (uint8_t) (((val) ) & 0xff)
#define set_triple(var,val) var[0] = ((val) >> 16) & 0xff; \
var[1] = ((val) >> 8 ) & 0xff; \
var[2] = ((val) ) & 0xff
#define set_triple(var,val) var[0] = (uint8_t) (((val) >> 16) & 0xff); \
var[1] = (uint8_t) (((val) >> 8 ) & 0xff); \
var[2] = (uint8_t) (((val) ) & 0xff)
#define set_quad(var,val) var[0] = ((val) >> 24) & 0xff; \
var[1] = ((val) >> 16) & 0xff; \
var[2] = ((val) >> 8 ) & 0xff; \
var[3] = ((val) ) & 0xff
#define set_quad(var,val) var[0] = (uint8_t) (((val) >> 24) & 0xff); \
var[1] = (uint8_t) (((val) >> 16) & 0xff); \
var[2] = (uint8_t) (((val) >> 8 ) & 0xff); \
var[3] = (uint8_t) (((val) ) & 0xff)
#define get_double(var) ((*var << 8) + *(var + 1))
@ -817,10 +882,10 @@ typedef struct acceleration_info
(*(var + 2) << 8) + *(var + 3))
/* set/get Avision lowended (little-endian) shading data */
#define set_double_le(var,val) var[0] = ((val) ) & 0xff; \
var[1] = ((val) >> 8) & 0xff
#define set_double_le(var,val) var[0] = (uint8_t) (((val) ) & 0xff); \
var[1] = (uint8_t) (((val) >> 8) & 0xff)
#define get_double_le(var) ((*(var + 1) << 8) + *var)
#define get_double_le(var) ((uint16_t) ((*(var + 1) << 8) + *(var)))
#define BIT(n, p) ((n & (1 << p)) ? 1 : 0)
@ -851,4 +916,29 @@ extern SANE_Status ENTRY(media_check) (SANE_Handle handle);
#endif
typedef enum
{
AVISION_DATATYPECODE_READ_IMAGE_DATA = 0x00,
AVISION_DATATYPECODE_GET_CALIBRATION_FORMAT = 0x60,
AVISION_DATATYPECODE_DETECT_ACCESSORIES = 0x64,
AVISION_DATATYPECODE_READ_NVRAM_DATA = 0x69,
AVISION_DATATYPECODE_FLASH_RAM_INFO = 0x6a,
AVISION_DATATYPECODE_ACCELERATION_TABLE = 0x6c,
AVISION_DATATYPECODE_DOWNLOAD_GAMMA_TABLE = 0x81,
AVISION_DATATYPECODE_3X3_COLOR_MATRIX = 0x83,
AVISION_DATATYPECODE_SEND_NVRAM_DATA = 0x85,
AVISION_DATATYPECODE_FLASH_DATA = 0x86,
AVISION_DATATYPECODE_FILM_HOLDER_SENSE = 0x87,
AVISION_DATATYPECODE_FIRMWARE_STATUS = 0x90,
AVISION_DATATYPECODE_ATTACH_TRUNCATE_TAIL = 0x95,
AVISION_DATATYPECODE_ATTACH_TRUNCATE_HEAD = 0x96,
AVISION_DATATYPECODE_GET_BACKGROUND_RASTER = 0x9b,
AVISION_DATATYPECODE_LIGHT_STATUS = 0xa0,
AVISION_DATATYPECODE_BUTTON_STATUS = 0xa1,
AVISION_DATATYPECODE_POWER_SAVING_TIMER = 0xa2,
AVISION_DATATYPECODE_READ_DUPLEX_INFO = 0xb1,
AVISION_DATATYPECODE_UNKNOWN = 0xd0,
AVISION_DATATYPECODE_READ_GENERAL_ABILITY_PARAM = 0xd2,
} Avision_Datatypecode;
#endif /* avision_h */

Wyświetl plik

@ -1895,6 +1895,11 @@ start_scan (BH_Scanner *s)
{
DBG(1, "sane_start: error opening barfile `%s'\n",
s->barfname);
if (fd !=-1)
{
close(fd);
unlink(s->barfname);
}
status = SANE_STATUS_IO_ERROR;
}
}
@ -1979,7 +1984,7 @@ sense_handler (int scsi_fd, u_char *result, void *arg)
SANE_Status status = SANE_STATUS_INVAL;
SANE_Char print_sense[(16 * 3) + 1];
scsi_fd = scsi_fd; /* get rid of compiler warning */
(void) scsi_fd; /* get rid of compiler warning */
ErrorCode = result[0] & 0x7F;
ValidData = (result[0] & 0x80) != 0;
sense = result[2] & 0x0f; /* Key */
@ -3145,16 +3150,16 @@ sane_init (SANE_Int *version_code, SANE_Auth_Callback authorize)
char devnam[PATH_MAX] = "/dev/scanner";
FILE *fp;
authorize = authorize; /* get rid of compiler warning */
(void) authorize; /* get rid of compiler warning */
DBG_INIT();
DBG(3, "sane_init called\n");
DBG(1, "Bell+Howell SANE backend %d.%d build %d %s endian\n",
SANE_CURRENT_MAJOR, V_MINOR, BUILD,
SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD,
_is_host_little_endian() ? "little" : "big");
if (version_code)
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, BUILD);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD);
fp = sanei_config_open(BH_CONFIG_FILE);
if (fp)
@ -3233,7 +3238,7 @@ sane_get_devices (const SANE_Device ***device_list, SANE_Bool local)
int i;
DBG(3, "sane_get_devices called\n");
local = local; /* get rid of compiler warning */
(void) local; /* get rid of compiler warning */
if (devlist)
free (devlist);
devlist = malloc ((num_devices + 1) * sizeof (devlist[0]));
@ -3806,7 +3811,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
return SANE_STATUS_GOOD;
#else
handle = handle; /* get rid of compiler warning */
(void) handle; /* get rid of compiler warning */
return (non_blocking == 1) ? SANE_STATUS_UNSUPPORTED : SANE_STATUS_GOOD;
#endif
}
@ -3828,7 +3833,7 @@ sane_get_select_fd (SANE_Handle handle, SANE_Int *fd)
return SANE_STATUS_GOOD;
#else
handle = handle; fd = fd; /* get rid of compiler warning */
(void) handle; (void) fd; /* get rid of compiler warning */
return SANE_STATUS_UNSUPPORTED;
#endif
}

Wyświetl plik

@ -55,7 +55,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback __sane_unused__ authorize
#endif
if (version_code)
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
fp = sanei_config_open (CANON_CONFIG_FILE);
if (fp)
@ -1111,9 +1111,6 @@ sane_start (SANE_Handle handle)
u_char cbuf[2]; /* modification for FB620S */
size_t buf_size, i;
char tmpfilename[] = "/tmp/canon.XXXXXX"; /* for FB1200S */
char *thistmpfile; /* for FB1200S */
DBG (1, ">> sane_start\n");
s->tmpfile = -1; /* for FB1200S */
@ -1121,36 +1118,18 @@ sane_start (SANE_Handle handle)
/******* making a tempfile for 1200 dpi scanning of FB1200S ******/
if (s->hw->info.model == FB1200)
{
thistmpfile = strdup(tmpfilename);
if (thistmpfile != NULL)
{
if (!mkstemp(thistmpfile))
{
DBG(1, "mkstemp(thistmpfile) is failed\n");
return (SANE_STATUS_INVAL);
}
}
else
{
DBG(1, "strdup(thistmpfile) is failed\n");
return (SANE_STATUS_INVAL);
}
s->tmpfile = open(thistmpfile, O_RDWR | O_CREAT | O_EXCL, 0600);
char tmpfilename[] = "/tmp/canon.XXXXXX"; /* for FB1200S */
s->tmpfile = mkstemp(tmpfilename);
if (s->tmpfile == -1)
{
DBG(1, "error opening temp file %s\n", thistmpfile);
DBG(1, "error opening temp file %s\n", tmpfilename);
DBG(1, "errno: %i; %s\n", errno, strerror(errno));
errno = 0;
return (SANE_STATUS_INVAL);
}
DBG(1, " ****** tmpfile is opened ****** \n");
unlink(thistmpfile);
free (thistmpfile);
DBG(1, "free thistmpfile\n");
unlink(tmpfilename);
}
/******************************************************************/

Wyświetl plik

@ -817,14 +817,12 @@ attach (const char *devnam, CANON_Device ** devp)
dev->sane.name = strdup (devnam);
dev->sane.vendor = "CANON";
if ((str = calloc (16 + 1, 1)) == NULL)
if ((str = strndup ((char *) ibuf + 16, 16)) == NULL)
{
sanei_scsi_close (fd);
fd = -1;
return (SANE_STATUS_NO_MEM);
}
strncpy (str, (char *) (ibuf + 16), 16);
dev->sane.model = str;
/* Register the fixed properties of the scanner below:
- whether it is a film scanner or a flatbed scanner
@ -842,6 +840,7 @@ attach (const char *devnam, CANON_Device ** devp)
if (!strncmp (str, "IX-27015", 8)) /* FS2700S */
{
dev->info.model = CS2700;
dev->sane.model = strdup("FS2700S");
dev->sane.type = SANE_I18N("film scanner");
dev->adf.Status = ADF_STAT_NONE;
dev->tpu.Status = TPU_STAT_NONE;
@ -857,6 +856,7 @@ attach (const char *devnam, CANON_Device ** devp)
else if (!strncmp (str, "IX-27025E", 9)) /* FS2710S */
{
dev->info.model = FS2710;
dev->sane.model = strdup("FS2710S");
dev->sane.type = SANE_I18N("film scanner");
dev->adf.Status = ADF_STAT_NONE;
dev->tpu.Status = TPU_STAT_NONE;
@ -872,6 +872,7 @@ attach (const char *devnam, CANON_Device ** devp)
else if (!strncmp (str, "IX-06035E", 9)) /* FB620S */
{
dev->info.model = FB620;
dev->sane.model = strdup("FB620S");
dev->sane.type = SANE_I18N("flatbed scanner");
dev->adf.Status = ADF_STAT_NONE;
dev->tpu.Status = TPU_STAT_NONE;
@ -887,6 +888,7 @@ attach (const char *devnam, CANON_Device ** devp)
else if (!strncmp (str, "IX-12015E", 9)) /* FB1200S */
{
dev->info.model = FB1200;
dev->sane.model = strdup("FB1200S");
dev->sane.type = SANE_I18N("flatbed scanner");
dev->adf.Status = ADF_STAT_INACTIVE;
dev->tpu.Status = TPU_STAT_INACTIVE;
@ -930,6 +932,20 @@ attach (const char *devnam, CANON_Device ** devp)
dev->info.has_fixed_resolutions = SANE_FALSE;
}
/*
* Use the model from the device if we don't have more
* common model name for the device, otherwise free the
* string with internal model name.
*
* Please keep the memory allocation source consistent
* for model string - allocate on the heap via dynamic
* allocation.
*/
if (dev->sane.model == NULL)
dev->sane.model = str;
else
free(str);
DBG (5, "dev->sane.name = '%s'\n", dev->sane.name);
DBG (5, "dev->sane.vendor = '%s'\n", dev->sane.vendor);
DBG (5, "dev->sane.model = '%s'\n", dev->sane.model);

Wyświetl plik

@ -937,7 +937,10 @@ plugin_cal (CANON_Handle * s)
{
DBG (1, "No temp filename!\n");
s->fname = strdup ("/tmp/cal.XXXXXX");
mkstemp (s->fname);
/* FIXME: we should be using fd, not discarding it, and also checking for error! */
int fd = mkstemp (s->fname);
close(fd);
}
s->width = 2551;
s->height = 75;
@ -1546,7 +1549,7 @@ CANON_open_device (CANON_Handle * scan, const char *dev)
static const char *
CANON_get_device_name (CANON_Handle * scanner)
{
scanner = scanner; /* Eliminate warning about unused parameters */
(void) scanner; /* Eliminate warning about unused parameters */
return "Canoscan FB630U";
}
@ -1581,8 +1584,12 @@ CANON_start_scan (CANON_Handle * scanner)
/* choose a temp file name for scan data */
scanner->fname = strdup ("/tmp/scan.XXXXXX");
if (!mkstemp (scanner->fname))
/* FIXME: we should be using fd, not discarding it! */
int fd = mkstemp (scanner->fname);
if (fd == -1)
return SANE_STATUS_IO_ERROR;
close(fd);
/* calibrate if needed */
rv = init (scanner->fd);

Wyświetl plik

@ -133,9 +133,9 @@ static SANE_Status
optionNumOptionsCallback (SANE_Option * option, SANE_Handle handle,
SANE_Action action, void *value, SANE_Int * info)
{
option = option;
handle = handle;
info = info; /* Eliminate warning about unused parameters */
(void) option;
(void) handle;
(void) info; /* Eliminate warning about unused parameters */
if (action != SANE_ACTION_GET_VALUE)
return SANE_STATUS_INVAL;
@ -168,8 +168,8 @@ static SANE_Status
optionCalibrateCallback (SANE_Option * option, SANE_Handle handle,
SANE_Action action, void *value, SANE_Int * info)
{
handle = handle;
option = option; /* Eliminate warning about unused parameters */
(void) handle;
(void) option; /* Eliminate warning about unused parameters */
switch (action)
{
@ -221,7 +221,7 @@ optionResolutionCallback (SANE_Option * option, SANE_Handle handle,
SANE_Status status;
SANE_Word autoValue = 75;
handle = handle; /* Eliminate warning about unused parameters */
(void) handle; /* Eliminate warning about unused parameters */
switch (action)
{
@ -268,8 +268,8 @@ static SANE_Status
optionGrayscaleCallback (SANE_Option * option, SANE_Handle handle,
SANE_Action action, void *value, SANE_Int * info)
{
handle = handle;
option = option; /* Eliminate warning about unused parameters */
(void) handle;
(void) option; /* Eliminate warning about unused parameters */
switch (action)
{
@ -315,9 +315,9 @@ static SANE_Status
optionAGainCallback (SANE_Option * option, SANE_Handle handle,
SANE_Action action, void *value, SANE_Int * info)
{
option = option;
handle = handle;
info = info; /* Eliminate warning about unused parameters */
(void) option;
(void) handle;
(void) info; /* Eliminate warning about unused parameters */
switch (action)
{
@ -357,9 +357,9 @@ static SANE_Status
optionGammaCallback (SANE_Option * option, SANE_Handle handle,
SANE_Action action, void *value, SANE_Int * info)
{
option = option;
handle = handle;
info = info; /* Eliminate warning about unused parameters */
(void) option;
(void) handle;
(void) info; /* Eliminate warning about unused parameters */
switch (action)
{
@ -418,9 +418,9 @@ static SANE_Status
optionTopLeftXCallback (SANE_Option * option, SANE_Handle handle,
SANE_Action action, void *value, SANE_Int * info)
{
option = option;
handle = handle;
value = value; /* Eliminate warning about unused parameters */
(void) option;
(void) handle;
(void) value; /* Eliminate warning about unused parameters */
switch (action)
{
@ -462,8 +462,8 @@ optionTopLeftYCallback (SANE_Option * option, SANE_Handle handle,
SANE_Action action, void *value, SANE_Int * info)
{
/* Eliminate warnings about unused parameters */
option = option;
handle = handle;
(void) option;
(void) handle;
switch (action)
{
@ -506,8 +506,8 @@ optionBotRightXCallback (SANE_Option * option, SANE_Handle handle,
SANE_Action action, void *value, SANE_Int * info)
{
/* Eliminate warnings about unused parameters */
option = option;
handle = handle;
(void) option;
(void) handle;
switch (action)
{
@ -550,8 +550,8 @@ optionBotRightYCallback (SANE_Option * option, SANE_Handle handle,
SANE_Action action, void *value, SANE_Int * info)
{
/* Eliminate warnings about unused parameters */
option = option;
handle = handle;
(void) option;
(void) handle;
switch (action)
{
@ -720,10 +720,10 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
DBG (2, "sane_init: version_code %s 0, authorize %s 0\n",
version_code == 0 ? "=" : "!=", authorize == 0 ? "=" : "!=");
DBG (1, "sane_init: SANE Canon630u backend version %d.%d.%d from %s\n",
SANE_CURRENT_MAJOR, V_MINOR, BUILD, PACKAGE_STRING);
SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD, PACKAGE_STRING);
if (version_code)
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, BUILD);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD);
sanei_usb_init ();
@ -912,7 +912,7 @@ sane_close (SANE_Handle handle)
const SANE_Option_Descriptor *
sane_get_option_descriptor (SANE_Handle handle, SANE_Int option)
{
handle = handle; /* Eliminate compiler warning */
(void) handle; /* Eliminate compiler warning */
DBG (3, "sane_get_option_descriptor: option = %d\n", option);
if (option < 0 || option >= NELEMS (so))
@ -924,7 +924,7 @@ SANE_Status
sane_control_option (SANE_Handle handle, SANE_Int option,
SANE_Action action, void *value, SANE_Int * info)
{
handle = handle; /* Eliminate compiler warning */
(void) handle; /* Eliminate compiler warning */
DBG (3,
"sane_control_option: handle=%p, opt=%d, act=%d, val=%p, info=%p\n",
@ -945,7 +945,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params)
SANE_UNFIX (optionBotRightYValue -
optionTopLeftYValue) / MM_IN_INCH * optionResolutionValue;
handle = handle; /* Eliminate compiler warning */
(void) handle; /* Eliminate compiler warning */
DBG (3, "sane_get_parameters\n");
parms.depth = 8;
@ -1035,7 +1035,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
{
handle = handle; /* silence gcc */
fd = fd; /* silence gcc */
(void) handle; /* silence gcc */
(void) fd; /* silence gcc */
return SANE_STATUS_UNSUPPORTED;
}

Wyświetl plik

@ -11,9 +11,7 @@
#define USB_HEADER_LEN 12
#define USB_COMMAND_LEN 12
#define USB_STATUS_LEN 4
#define USB_COMMAND_TIME 30000
#define USB_DATA_TIME 30000
#define USB_STATUS_TIME 30000
#define USB_PACKET_TIMEOUT 30000
/*static inline void */
static void
@ -116,8 +114,10 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
#define INQUIRY_code 0x12
#define INQUIRY_len 6
#define INQUIRY_std_len 0x30
#define INQUIRY_vpd_len 0x1e
#define INQUIRY_std_max_len 0x30
#define INQUIRY_std_typ_len 0x30
#define INQUIRY_vpd_max_len 0x30
#define INQUIRY_vpd_typ_len 0x1e
#define set_IN_evpd(icb, val) setbitfield(icb + 1, 1, 0, val)
#define set_IN_page_code(icb, val) icb[0x02]=val
@ -131,9 +131,12 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
#define IN_periph_devtype_unknown 0x1f
#define get_IN_response_format(in) getbitfield(in + 0x03, 0x07, 0)
#define IN_recognized 0x02
#define get_IN_vendor(in, buf) strncpy(buf, (char *)in + 0x08, 0x08)
#define get_IN_product(in, buf) strncpy(buf, (char *)in + 0x10, 0x010)
#define get_IN_version(in, buf) strncpy(buf, (char *)in + 0x20, 0x04)
#define get_IN_vendor(in, buf) snprintf(buf, 0x08 + 1, "%.*s", \
0x08, (char*)in + 0x08)
#define get_IN_product(in, buf) snprintf(buf, 0x10 + 1, "%.*s", \
0x10, (char*)in + 0x10)
#define get_IN_version(in, buf) snprintf(buf, 0x04 + 1, "%.*s", \
0x04, (char*)in + 0x20)
/* the VPD response */
#define get_IN_page_length(in) in[0x04]
@ -219,6 +222,7 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
#define SR_datatype_endorser 0x90
#define SR_datatype_fineoffset 0x90
#define SR_datatype_finegain 0x91
#define SR_datatype_imprinters 0x96 /*DR-X10C*/
/* ==================================================================== */
/* READ */
@ -252,7 +256,20 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
/*counters*/
#define R_COUNTERS_len 0x80
#define get_R_COUNTERS_scans(in) getnbyte(in + 0x04, 4)
#define get_R_COUNTERS_total(in) getnbyte(in + 0x04, 4)
#define get_R_COUNTERS_last_srv(in) getnbyte(in + 0x44, 4)
/*imprinters*/
#define R_IMPRINTER_len 0x20
#define R_PRE_IMPRINTER 0
#define R_POST_IMPRINTER 1
#define get_R_IMPRINTER_found(in) getbitfield(in+1, 1, 0)
/*4 bytes at in + 0: (DR-X10C)
pre-imprinter on: 0x07010000
pre-imprinter off: 0x06000000
post-imprinter on: 0x03010000
post-imprinter off: 0x02000000
*/
/*endorser unread?*/
@ -454,6 +471,14 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
#define SM2_pc_buffer 0x02
#define SM2_pc_hw_enhancement 0x03
#define SM2_pc_dropout 0x06
#define SM2_pc_date_time 0x07
#define SM2_pc_imprinter_settings 0x33
#define SM2_pc_imprinter_specstring 0x34
/* ==================================================================== */
/* GET SCAN MODE 2 */
#define GET_SCAN_MODE2_code 0xe4
#define GET_SCAN_MODE2_len 12
/* ==================================================================== */
/* SET SCAN MODE 2 */
@ -465,11 +490,15 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
/* the payload */
#define SSM2_PAY_len 0x10
#define SSM2_IMPRINTER_STRING_PAY_len 0x8e
/* for DF (0x00) page */
#define set_SSM2_DF_thick(sb, val) setbitfield(sb+3, 1, 2, val)
#define set_SSM2_DF_imprint(sb, val) setbitfield(sb+2, 1, 0, val)
#define set_SSM2_DF_post_addon(sb, val) setbitfield(sb+2, 1, 1, val)
#define set_SSM2_DF_len(sb, val) setbitfield(sb+3, 1, 0, val)
#define set_SSM2_DF_thick(sb, val) setbitfield(sb+3, 1, 2, val)
#define set_SSM2_DF_staple(sb, val) setbitfield(sb+3, 1, 4, val)
#define set_SSM2_DF_imprint2(sb, val) setbitfield(sb+3, 1, 6, val)
/* for ULTRA (0x01) page */
#define set_SSM2_ULTRA_top(sb, val) putnbyte(sb + 0x07, val, 2)
@ -489,6 +518,32 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
#define set_SSM2_DO_en(sb, val) sb[0x0a] = val
#define set_SSM2_DO_side(sb, val) sb[0x05] = val
/* for IMPRINT DATE & TIME (0x07) */
#define set_SSM2_imprint_year(sb, val) putnbyte(sb + 0x02, val, 2)
#define set_SSM2_imprint_month(sb, val) putnbyte(sb + 0x04, val, 1)
#define set_SSM2_imprint_day(sb, val) putnbyte(sb + 0x05, val, 1)
#define set_SSM2_imprint_hour(sb, val) putnbyte(sb + 0x06, val, 1)
#define set_SSM2_imprint_min(sb, val) putnbyte(sb + 0x07, val, 1)
#define set_SSM2_imprint_sec(sb, val) putnbyte(sb + 0x08, val, 1)
/* for IMPRINTER SETTINGS (0x33) page */
#define set_SSM2_postimprint_cmd(sb) sb[0x04] = 1
#define set_SSM2_postimprint_addon(sb) setbitfield(sb, 1, 1, 1)
#define set_SSM2_imprint_hoffset(sb, val) putnbyte(sb + 0x05, val, 2)
#define set_SSM2_imprint_voffset(sb, val) putnbyte(sb + 0x07, val, 2)
/* for IMPRINTER STRING SPECIFICATION (0x34) page */
#define IMPRINTER_12x12_FONT 0
#define IMPRINTER_8x12_FONT 1
#define set_SSM2_imprint_fontsize(sb, val) setbitfield(sb + 0xA, 1, 0, val)
#define set_SSM2_imprint_spacing(sb, val) setbitfield(sb + 0xA, 1, 1, val)
#define set_SSM2_imprint_addonmode(sb, val) setbitfield(sb + 0x9, 3, 4, val)
#define IMPRINTER_0_FONT_ROT 0
#define IMPRINTER_90_FONT_ROT 1
#define IMPRINTER_180_FONT_ROT 2
#define IMPRINTER_270_FONT_ROT 3
#define set_SSM2_imprint_fontrot(sb, val) setbitfield(sb + 0x9, 3, 0, val)
/* ==================================================================== */
/* window descriptor macros for SET_WINDOW and GET_WINDOW */

Plik diff jest za duży Load Diff

Wyświetl plik

@ -103,6 +103,7 @@ option duplex-offset 400
usb 0x1083 0x1617
# DR-X10C
option tur-timeout 5000
usb 0x1083 0x1618
# CR-25
@ -173,6 +174,7 @@ usb 0x1083 0x164a
usb 0x1083 0x164b
# P-208
option duplex-offset 260
usb 0x1083 0x164c
# DR-G1130
@ -194,6 +196,8 @@ option duplex-offset 1640
usb 0x1083 0x1654
# DR-M1060
option inquiry-length 0x24
option vpd-length 0x30
usb 0x1083 0x1657
# DR-C225
@ -210,3 +214,7 @@ usb 0x1083 0x165d
# P-208II
usb 0x1083 0x165f
# R40
option duplex-offset 320
usb 0x1083 0x1679

Wyświetl plik

@ -51,6 +51,22 @@ enum scanner_Option
OPT_SIDE,
OPT_HW_CROP,
/*imprinter option group*/
OPT_IMPRINT_GROUP,
OPT_PRE_IMPRINT_SPECSTRING,
OPT_PRE_IMPRINT_H_OFFSET,
OPT_PRE_IMPRINT_V_OFFSET,
OPT_PRE_IMPRINT_FONT_SIZE,
OPT_PRE_IMPRINT_FONT_ROT,
OPT_PRE_IMPRINT_SPACING,
OPT_POST_IMPRINT_SPECSTRING,
OPT_POST_IMPRINT_H_OFFSET,
OPT_POST_IMPRINT_V_OFFSET,
OPT_POST_IMPRINT_FONT_SIZE,
OPT_POST_IMPRINT_FONT_ROT,
OPT_POST_IMPRINT_SPACING,
OPT_POST_IMPRINT_ADDON_MODE,
/*sensor group*/
OPT_SENSOR_GROUP,
OPT_START,
@ -60,6 +76,8 @@ enum scanner_Option
OPT_COUNTONLY,
OPT_BYPASSMODE,
OPT_COUNTER,
OPT_ROLLERCOUNTER,
OPT_TOTALCOUNTER,
OPT_ADF_LOADED,
OPT_CARD_LOADED,
@ -106,6 +124,32 @@ struct img_params
};
struct imprint_params
{
/* ------------------------------------------------------------------------------ */
/* allowed values for post imprinter (in mm units): */
/* 21, 35, 47, 59, 72, 99, 114, 143, 155, 167, 196, 211, 239, 251, 263, 275, 289 */
/* allowed values for pre imprinter (in mm units): */
/* 14, 28, 41, 53, 65, 106 */
int h_offset;
/* --------------------------------------- */
/* allowed values: 0 to 500 (in mm units) */
int v_offset;
int font_size;
int font_rot;
int spacing;
#define IMPRINT_SPECSTRING_LEN 64
/* ---------------------------------- */
/* special tokens: */
/* \TIME time in HH:MM:SS */
/* \DMY date in DD/MM/YYYY */
/* \YMD date in YYYY/MM/DD */
/* [[0-9]+] scan page count */
char specstring[IMPRINT_SPECSTRING_LEN];
};
struct scanner
{
/* --------------------------------------------------------------------- */
@ -116,12 +160,18 @@ struct scanner
/* --------------------------------------------------------------------- */
/* immutable values which are set during reading of config file. */
int connection; /* hardware interface type */
int buffer_size;
int connection; /* hardware interface type */
int duplex_offset; /* number of lines of padding added to front (1/1200)*/
int extra_status; /* some machines need extra status read after cmd */
int inquiry_length; /* some models are particular about inquiry size */
int padded_read; /* some machines need extra 12 bytes on reads */
int tur_timeout; /* some models are slow to wake up */
int vpd_length; /* some models are particular about vpd size */
/* --------------------------------------------------------------------- */
/* immutable values which are set during inquiry probing of the scanner. */
/* members in order found in scsi data... */
/* members in order found in scsi data. These can also be in config file */
char vendor_name[9]; /* raw data as returned by SCSI inquiry. */
char model_name[17]; /* raw data as returned by SCSI inquiry. */
char version_name[5]; /* raw data as returned by SCSI inquiry. */
@ -198,17 +248,18 @@ struct scanner
int has_ssm2; /* newer scanners user this similar command */
int has_ssm_pay_head_len; /* newer scanners put the length twice in ssm */
int has_hwcrop;
int has_pre_imprinter;
int has_post_imprinter;
int can_read_sensors;
int can_read_panel;
int can_write_panel;
int can_read_lifecycle_counters;
int rgb_format; /* meaning unknown */
int padding; /* meaning unknown */
int always_op; /* send object pos between pages */
int invert_tly; /* weird bug in some smaller scanners */
int unknown_byte2; /* weird byte, required, meaning unknown */
int padded_read; /* some machines need extra 12 bytes on reads */
int extra_status; /* some machines need extra status read after cmd */
int fixed_width; /* some machines always scan full width */
int even_Bpl; /* some machines require even bytes per line */
@ -217,7 +268,6 @@ struct scanner
int color_inter_by_res[16]; /* and some even change by resolution */
int duplex_interlace; /* different models interlace sides differently */
int jpeg_interlace; /* different models interlace jpeg sides differently */
int duplex_offset; /* number of lines of padding added to front (1/1200)*/
int duplex_offset_side; /* padding added to front or back? */
int sw_lut; /* no hardware brightness/contrast support */
@ -314,13 +364,34 @@ struct scanner
unsigned char lut[256];
/* --------------------------------------------------------------------- */
/* values used by the software enhancement code (deskew, crop, etc) */
/* values used by the software enhancement code (deskew, crop, etc) */
SANE_Status deskew_stat;
int deskew_vals[2];
double deskew_slope;
int crop_vals[4];
/* imprinter params */
struct imprint_params pre_imprint;
struct imprint_params post_imprint;
enum {
/*Black-on-White*/
ADDON_BoW = 0,
/*White-on-Black*/
ADDON_WoB,
/*Black-on-Image*/
ADDON_BoI,
ADDON_DISABLED
} post_imprint_addon_mode;
/* imprinter param constraints */
SANE_Int pre_imprinter_h_offset_list[7];
SANE_Int post_imprinter_h_offset_list[18];
SANE_Range imprinter_v_offset_range;
SANE_String_Const imprint_font_size_list[3];
SANE_Int imprinter_font_angle_list[5];
SANE_String_Const imprint_addon_mode_list[5];
/* this is defined in sane spec as a struct containing:
SANE_Frame format;
SANE_Bool last_frame;
@ -376,6 +447,8 @@ struct scanner
int panel_counter;
int sensor_adf_loaded;
int sensor_card_loaded;
int roller_counter;
int total_counter;
/* values which are used to track the frontend's access to sensors */
char panel_read[OPT_COUNTER - OPT_START + 1];
@ -538,7 +611,9 @@ static SANE_Status sense_handler (int scsi_fd, u_char * result, void *arg);
static SANE_Status init_inquire (struct scanner *s);
static SANE_Status init_vpd (struct scanner *s);
static SANE_Status init_model (struct scanner *s);
static SANE_Status init_imprinters (struct scanner *s);
static SANE_Status init_panel (struct scanner *s);
static SANE_Status init_counters (struct scanner *s);
static SANE_Status init_user (struct scanner *s);
static SANE_Status init_options (struct scanner *s);
@ -586,6 +661,7 @@ static SANE_Status update_params (struct scanner *s, int calib);
static SANE_Status update_i_params (struct scanner *s);
static SANE_Status clean_params (struct scanner *s);
static SANE_Status read_counters(struct scanner *s);
static SANE_Status read_sensors(struct scanner *s, SANE_Int option);
static SANE_Status read_panel(struct scanner *s, SANE_Int option);
static SANE_Status send_panel(struct scanner *s);
@ -629,6 +705,12 @@ static SANE_Status calibrate_fine_dest_hw(struct scanner *s);
static SANE_Status write_AFE (struct scanner *s);
static SANE_Status calibration_scan (struct scanner *s, int);
static SANE_Status send_imprint_positioning(struct scanner* s, int is_postimprint, int enabled);
static SANE_Status send_imprint_specstring(struct scanner* s, int is_postimprint);
static SANE_Status send_imprint_date_and_time(struct scanner* s);
static SANE_Status load_imprinting_settings(struct scanner *s);
static SANE_Status detect_imprinter(struct scanner *s, SANE_Int option);
static void hexdump (int level, char *comment, unsigned char *p, int l);
static void default_globals (void);

Wyświetl plik

@ -225,10 +225,10 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
DBG (2, "sane_init: version_code %s 0, authorize %s 0\n",
version_code == 0 ? "=" : "!=", authorize == 0 ? "=" : "!=");
DBG (1, "sane_init: SANE Canon LiDE70 backend version %d.%d.%d from %s\n",
V_MAJOR, V_MINOR, BUILD, PACKAGE_STRING);
SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD, PACKAGE_STRING);
if (version_code)
*version_code = SANE_VERSION_CODE (V_MAJOR, V_MINOR, BUILD);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD);
sanei_usb_init ();
@ -819,8 +819,8 @@ sane_control_option (SANE_Handle handle, SANE_Int option, SANE_Action action,
"sane_control_option: get option %d (%s), value=%.1f %s\n",
option, chndl->opt[option].name,
SANE_UNFIX (*(SANE_Fixed *) value),
chndl->opt[option].unit ==
SANE_UNIT_MM ? "mm" : SANE_UNIT_DPI ? "dpi" : "");
chndl->opt[option].unit == SANE_UNIT_MM ? "mm" :
(chndl->opt[option].unit == SANE_UNIT_DPI ? "dpi" : ""));
break;
}
case opt_non_blocking:
@ -863,7 +863,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params)
Canon_Scanner *hndl = handle; /* Eliminate compiler warning */
CANON_Handle *chndl = &hndl->scan;
int rc = SANE_STATUS_GOOD;
SANE_Status rc = SANE_STATUS_GOOD;
int w = SANE_UNFIX (chndl->val[opt_br_x].w -
chndl->val[opt_tl_x].w) / MM_IN_INCH *
chndl->val[opt_resolution].w;
@ -956,7 +956,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
{
handle = handle; /* silence gcc */
fd = fd; /* silence gcc */
(void) handle; /* silence gcc */
(void) fd; /* silence gcc */
return SANE_STATUS_UNSUPPORTED;
}

Wyświetl plik

@ -178,8 +178,8 @@ int sanei_canon_pp_wake_scanner(struct parport *port, int mode)
usleep(100000);
}
} while ((i < max_cycles) && (!expect(port,"Scanner wakeup reply 2",
0x03, 0x1f, 100000) == 0));
} while ((i < max_cycles) && expect(port, "Scanner wakeup reply 2",
0x03, 0x1f, 100000));
/* Block just after chessboarding
Reply 1 (S3 and S4 on, S5 and S7 off) */

Wyświetl plik

@ -147,7 +147,7 @@ sane_init (SANE_Int *vc, SANE_Auth_Callback cb)
#endif
if(vc)
*vc = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
*vc = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
DBG(2,"sane_init: >> ieee1284_find_ports\n");
/* Find lp ports */
@ -1787,7 +1787,9 @@ static int init_cal(char *file)
************************************************************************/
static SANE_Status fix_weights_file(CANONP_Scanner *cs)
{
char *tmp, *myhome, buf[PATH_MAX];
static const char default_weights_file_prefix[] =
"~/.sane/canon_pp-calibration-";
char *tmp, *myhome;
int i;
struct stat *f_stat;
@ -1804,31 +1806,32 @@ static SANE_Status fix_weights_file(CANONP_Scanner *cs)
if (cs->weights_file == NULL)
{
/* Will be of form canon_pp-calibration-parport0 or -0x378 */
sprintf(buf, "~/.sane/canon_pp-calibration-%s",
/* Form is ~/.sane/canon_pp-calibration-parport0 or -0x378 */
i = strlen(default_weights_file_prefix) +
strlen(cs->params.port->name);
if ((cs->weights_file = malloc(i + 1)) == NULL)
return SANE_STATUS_NO_MEM;
sprintf(cs->weights_file, "%s%s", default_weights_file_prefix,
cs->params.port->name);
cs->weights_file = strdup(buf);
}
/* Get the user's home dir if they used ~ */
if (cs->weights_file[0] == '~')
{
if ((tmp = malloc(PATH_MAX)) == NULL)
return SANE_STATUS_NO_MEM;
if ((myhome = getenv("HOME")) == NULL)
{
DBG(0,"fix_weights_file: FATAL: ~ used, but $HOME not"
" set!\n");
free(tmp);
tmp = NULL;
return SANE_STATUS_INVAL;
}
strncpy(tmp, myhome, PATH_MAX);
strncpy(tmp+strlen(tmp), (cs->weights_file)+1,
PATH_MAX-strlen(tmp));
i = strlen(myhome) + strlen(&cs->weights_file[1]);
if ((tmp = malloc(i + 1)) == NULL)
return SANE_STATUS_NO_MEM;
sprintf(tmp, "%s%s", myhome, &cs->weights_file[1]);
free(cs->weights_file);
cs->weights_file = tmp;
tmp = NULL;
}
if ((f_stat = malloc(sizeof(*f_stat))) == NULL)

Wyświetl plik

@ -271,7 +271,7 @@ static struct scanner *scanner_devList = NULL;
SANE_Status
sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
{
authorize = authorize; /* get rid of compiler warning */
(void) authorize; /* get rid of compiler warning */
DBG_INIT ();
DBG (10, "sane_init: start\n");
@ -279,10 +279,10 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
sanei_usb_init();
if (version_code)
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, BUILD);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD);
DBG (5, "sane_init: cardscan backend %d.%d.%d, from %s\n",
SANE_CURRENT_MAJOR, V_MINOR, BUILD, PACKAGE_STRING);
SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD, PACKAGE_STRING);
DBG (10, "sane_init: finish\n");
@ -323,7 +323,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
int num_devices=0;
int i=0;
local_only = local_only; /* get rid of compiler warning */
(void) local_only; /* get rid of compiler warning */
DBG (10, "sane_get_devices: start\n");

Wyświetl plik

@ -1853,8 +1853,8 @@ hexdump (int level, char *comment, unsigned char *p, int l)
static SANE_Status
sense_handler (int scsi_fd, unsigned char * result, void *arg)
{
scsi_fd = scsi_fd;
arg = arg;
(void) scsi_fd;
(void) arg;
if (result[0] != 0x70)
{
@ -2155,7 +2155,7 @@ attach_one (const char *devName)
static void
sigterm_handler (int signal)
{
signal = signal;
(void) signal;
sanei_scsi_req_flush_all (); /* flush SCSI queue */
_exit (SANE_STATUS_GOOD);
}
@ -2360,7 +2360,7 @@ static int RGBIfix16(Coolscan_t * scanner,
unsigned short *opr,*opg,*opb,*opi;
int x;
scanner = scanner; lutr = lutr; lutg = lutg; lutb = lutb; luti = luti;
(void) scanner; (void) lutr; (void) lutg; (void) lutb; (void) luti;
for(x=0;x<size;x++)
{
@ -2459,7 +2459,7 @@ static int RGBIfix1(unsigned char* rgbimat,unsigned char* orgbimat,
int ii;
int x;
lutg = lutg; lutb = lutb;
(void) lutg; (void) lutb;
/* calculate regression between r and ir */
cc.sum=0;
@ -3237,14 +3237,14 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
size_t len;
FILE *fp;
authorize = authorize;
(void) authorize;
DBG_INIT ();
sanei_thread_init ();
DBG (10, "sane_init\n");
if (version_code)
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
fp = sanei_config_open (COOLSCAN_CONFIG_FILE);
if (!fp)
@ -3297,7 +3297,7 @@ sane_get_devices (const SANE_Device *** device_list,
Coolscan_t *dev;
int i;
local_only = local_only;
(void) local_only;
DBG (10, "sane_get_devices\n");

Wyświetl plik

@ -344,11 +344,11 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
DBG (10, "sane_init() called.\n");
DBG (1, "coolscan2 backend, version %i.%i.%i initializing.\n", CS2_VERSION_MAJOR, CS2_VERSION_MINOR, CS2_REVISION);
authorize = authorize; /* to shut up compiler */
(void) authorize; /* to shut up compiler */
if (version_code)
*version_code =
SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
sanei_usb_init ();
@ -378,7 +378,7 @@ sane_get_devices (const SANE_Device *** list, SANE_Bool local_only)
char line[PATH_MAX], *p;
FILE *config;
local_only = local_only; /* to shut up compiler */
(void) local_only; /* to shut up compiler */
DBG (10, "sane_get_devices() called.\n");
@ -468,7 +468,10 @@ sane_open (SANE_String_Const name, SANE_Handle * h)
for (i_option = 0; i_option < CS2_N_OPTIONS; i_option++)
{
o.name = o.title = o.desc = NULL;
o.type = o.unit = o.cap = o.constraint_type = o.size = 0;
o.type = SANE_TYPE_BOOL;
o.unit = SANE_UNIT_NONE;
o.size = o.cap = 0;
o.constraint_type = SANE_CONSTRAINT_NONE;
o.constraint.range = NULL; /* only one union member needs to be NULLed */
switch (i_option)
{
@ -1738,8 +1741,8 @@ sane_get_select_fd (SANE_Handle h, SANE_Int * fd)
DBG (10, "sane_get_select_fd() called.\n");
fd = fd; /* to shut up compiler */
s = s; /* to shut up compiler */
(void) fd; /* to shut up compiler */
(void) s; /* to shut up compiler */
return SANE_STATUS_UNSUPPORTED;
}
@ -2003,7 +2006,7 @@ cs2_scsi_sense_handler (int fd, u_char * sense_buffer, void *arg)
{
cs2_t *s = (cs2_t *) arg;
fd = fd; /* to shut up compiler */
(void) fd; /* to shut up compiler */
/* sort this out ! XXXXXXXXX */

Wyświetl plik

@ -314,10 +314,10 @@ sane_init(SANE_Int * version_code, SANE_Auth_Callback authorize)
DBG(1, "coolscan3 backend, version %i.%i.%i initializing.\n",
CS3_VERSION_MAJOR, CS3_VERSION_MINOR, CS3_REVISION);
authorize = authorize; /* to shut up compiler */
(void) authorize; /* to shut up compiler */
if (version_code)
*version_code = SANE_VERSION_CODE(SANE_CURRENT_MAJOR, V_MINOR, 0);
*version_code = SANE_VERSION_CODE(SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
sanei_usb_init();
@ -346,7 +346,7 @@ sane_get_devices(const SANE_Device *** list, SANE_Bool local_only)
char line[PATH_MAX], *p;
FILE *config;
local_only = local_only; /* to shut up compiler */
(void) local_only; /* to shut up compiler */
DBG(10, "%s\n", __func__);
@ -424,7 +424,10 @@ sane_open(SANE_String_Const name, SANE_Handle * h)
for (i_option = 0; i_option < CS3_N_OPTIONS; i_option++) {
o.name = o.title = o.desc = NULL;
o.type = o.unit = o.cap = o.constraint_type = o.size = 0;
o.type = SANE_TYPE_BOOL;
o.unit = SANE_UNIT_NONE;
o.size = o.cap = 0;
o.constraint_type = SANE_CONSTRAINT_NONE;
o.constraint.range = NULL; /* only one union member needs to be NULLed */
switch (i_option) {
case CS3_OPTION_NUM:
@ -1746,8 +1749,8 @@ sane_get_select_fd(SANE_Handle h, SANE_Int * fd)
DBG(10, "%s\n", __func__);
fd = fd; /* to shut up compiler */
s = s; /* to shut up compiler */
(void) fd; /* to shut up compiler */
(void) s; /* to shut up compiler */
return SANE_STATUS_UNSUPPORTED;
}
@ -2026,7 +2029,7 @@ cs3_scsi_sense_handler(int fd, u_char * sense_buffer, void *arg)
{
cs3_t *s = (cs3_t *) arg;
fd = fd; /* to shut up compiler */
(void) fd; /* to shut up compiler */
/* sort this out ! XXX */

Wyświetl plik

@ -663,7 +663,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback __sane_unused__ authorize
DBG_INIT ();
if (version_code)
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
fp = sanei_config_open (DC210_CONFIG_FILE);

Wyświetl plik

@ -820,7 +820,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback __sane_unused__ authorize
DBG_INIT ();
if (version_code)
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
fp = sanei_config_open (DC240_CONFIG_FILE);

Wyświetl plik

@ -134,8 +134,7 @@ static char tty_name[PATH_MAX];
#define DEF_TTY_NAME "/dev/ttyS0"
static speed_t tty_baud = DEFAULT_TTY_BAUD;
static char *tmpname;
static char tmpnamebuf[] = "/tmp/dc25XXXXXX";
#define TMPFILE_PATTERN "/tmp/dc25XXXXXX";
static Dc20Info *dc20_info;
static Dc20Info CameraInfo;
@ -925,7 +924,6 @@ adjust_color_and_saturation (short red[], short green[], short blue[])
int line, column;
int r_min = SMAX, g_min = SMAX, b_min = SMAX;
int r_max = 0, g_max = 0, b_max = 0;
int r_sum = 0, g_sum = 0, b_sum = 0;
float sqr_saturation = sqrt (saturation);
for (line = TOP_MARGIN; line < HEIGHT - BOTTOM_MARGIN; line++)
{
@ -1008,9 +1006,6 @@ adjust_color_and_saturation (short red[], short green[], short blue[])
g_max = g;
if (b_max < b)
b_max = b;
r_sum += r;
g_sum += g;
b_sum += b;
BIDIM_ARRAY (red, column, line, columns) = r;
BIDIM_ARRAY (green, column, line, columns) = g;
BIDIM_ARRAY (blue, column, line, columns) = b;
@ -1153,7 +1148,6 @@ output_rgb (const short red[],
{
int r_min = 255, g_min = 255, b_min = 255;
int r_max = 0, g_max = 0, b_max = 0;
int r_sum = 0, g_sum = 0, b_sum = 0;
int column, line;
unsigned char *gamma_table = make_gamma_table (high_i - low_i);
@ -1202,19 +1196,9 @@ output_rgb (const short red[],
g_max = g;
if (b_max < b)
b_max = b;
r_sum += r;
g_sum += g;
b_sum += b;
}
}
free (gamma_table);
/*
{
fprintf (stderr, "%s: output_rgb: r: min = %d, max = %d, ave = %d\n", __progname, r_min, r_max, r_sum / NET_PIXELS);
fprintf (stderr, "%s: output_rgb: g: min = %d, max = %d, ave = %d\n", __progname, g_min, g_max, g_sum / NET_PIXELS);
fprintf (stderr, "%s: output_rgb: b: min = %d, max = %d, ave = %d\n", __progname, b_min, b_max, b_sum / NET_PIXELS);
}
*/
return 0;
}
@ -1833,7 +1817,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback __sane_unused__ authorize
DBG_INIT ();
if (version_code)
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
fp = sanei_config_open (DC25_CONFIG_FILE);
@ -2022,16 +2006,6 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle)
DBG (1, "No device info\n");
}
if (tmpname == NULL)
{
tmpname = tmpnamebuf;
if (!mkstemp (tmpname))
{
DBG (1, "Unable to make temp file %s\n", tmpname);
return SANE_STATUS_INVAL;
}
}
DBG (3, "sane_open: pictures taken=%d\n", dc20_info->pic_taken);
return SANE_STATUS_GOOD;
@ -2445,14 +2419,15 @@ sane_start (SANE_Handle handle)
* port overruns on a 90MHz pentium until I used hdparm
* to set the "-u1" flag on the system drives.
*/
int fd;
char tmpnamebuf[] = TMPFILE_PATTERN;
fd = open (tmpname, O_CREAT | O_EXCL | O_WRONLY, 0600);
int fd = mkstemp (tmpnamebuf);
if (fd == -1)
{
DBG (0, "Unable to open tmp file\n");
return SANE_STATUS_INVAL;
}
{
DBG (0, "Unable to make temp file %s\n", tmpnamebuf);
return SANE_STATUS_INVAL;
}
f = fdopen (fd, "wb");
if (f == NULL)
{
@ -2524,12 +2499,12 @@ sane_start (SANE_Handle handle)
else
{
fclose (f);
if (convert_pic (tmpname, SAVE_ADJASPECT | SAVE_24BITS) == -1)
if (convert_pic (tmpnamebuf, SAVE_ADJASPECT | SAVE_24BITS) == -1)
{
DBG (3, "sane_open: unable to convert\n");
return SANE_STATUS_INVAL;
}
unlink (tmpname);
unlink (tmpnamebuf);
outbytes = 0;
}
}

Wyświetl plik

@ -86,7 +86,7 @@
#define MAX_SCANNERS 32
/* version number */
#define DRIVER_VERSION SANE_VERSION_CODE( SANE_CURRENT_MAJOR, V_MINOR, 0 )
#define DRIVER_VERSION SANE_VERSION_CODE( SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0 )
/* size of buffer for socket communication */
#define SOCK_BUF_SIZE 2048
@ -946,7 +946,7 @@ HexDump (int debugLevel, const unsigned char *buf, size_t bufSize)
{
if (!(i % 16))
sprintf (lineBuf, "%p: ", (buf + i));
sprintf (lineBuf, "%p: ", (void *) &buf[i]);
sprintf (itemBuf, "%02x ", (const unsigned int) buf[i]);
@ -1199,7 +1199,7 @@ ProcessFindResponse (unsigned char *pData, size_t size)
DBG (10, "ProcessFindResponse: processing %lu bytes, pData=%p\n",
(unsigned long)size, pData);
(unsigned long) size, (void *) pData);
/* check we have a complete packet */
if (!MessageIsComplete (pData, size))
@ -1355,7 +1355,7 @@ ProcessUdpResponse (unsigned char *pData, size_t size,
HexDump (15, pData, size);
DBG (10, "ProcessUdpResponse: processing %lu bytes, pData=%p\n",
(unsigned long)size, pData);
(unsigned long) size, (void *) pData);
/* check we have a complete packet */
if (!MessageIsComplete (pData, size))
@ -1486,7 +1486,7 @@ ProcessTcpResponse (struct ScannerState *pState, struct ComBuf *pTcpBuf)
int bProcessImage = 0;
DBG (10, "ProcessTcpResponse: processing %lu bytes, pData=%p\n",
(unsigned long)pTcpBuf->m_used, pData);
(unsigned long) pTcpBuf->m_used, (void *) pData);
HexDump (15, pData, pTcpBuf->m_used);
/* if message not complete then wait for more to arrive */
@ -1799,7 +1799,7 @@ ProcessPageData (struct ScannerState *pState)
struct PageInfo pageInfo;
JSAMPLE *pJpegLine = NULL;
uint32 *pTiffRgba = NULL;
uint32_t *pTiffRgba = NULL;
unsigned char *pOut;
char tiffErrBuf[1024];

Wyświetl plik

@ -1068,7 +1068,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
char *full_name;
int i, num_devs;
size_t len;
#define ASSERT_SPACE(n) \
#define ASSERT_SPACE(n) do \
{ \
if (devlist_len + (n) > devlist_size) \
{ \
@ -1080,7 +1080,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
if (!devlist) \
return SANE_STATUS_NO_MEM; \
} \
}
} while (0)
DBG (3, "sane_get_devices\n");
@ -1365,7 +1365,7 @@ sane_read (SANE_Handle handle, SANE_Byte * data, SANE_Int max_length,
struct meta_scanner *s = handle;
DBG (3, "sane_read(handle=%p,data=%p,maxlen=%d,lenp=%p)\n",
handle, data, max_length, (void *) length);
handle, (void *) data, max_length, (void *) length);
return (*(op_read_t)s->be->op[OP_READ]) (s->handle, data, max_length, length);
}

Wyświetl plik

@ -1,5 +1,5 @@
/* sane - Scanner Access Now Easy.
Copyright (C) 1998 David F. Skoll
Copyright (C) 1998 Dianne Skoll
Heavily based on "hp.c" driver for HP Scanners, by
David Mosberger-Tang.
@ -812,11 +812,11 @@ sane_init(SANE_Int *version_code, SANE_Auth_Callback authorize)
size_t len;
FILE *fp;
authorize = authorize;
(void) authorize;
DBG_INIT();
if (version_code) {
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, 0);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 0);
}
fp = sanei_config_open(DMC_CONFIG_FILE);
@ -891,7 +891,7 @@ sane_get_devices(SANE_Device const ***device_list, SANE_Bool local_only)
DMC_Device *dev;
int i = 0;
local_only = local_only;
(void) local_only;
if (devlist) free(devlist);
devlist = malloc((NumDevices+1) * sizeof(devlist[0]));
@ -1392,8 +1392,8 @@ sane_cancel (SANE_Handle handle)
SANE_Status
sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
{
handle = handle;
non_blocking = non_blocking;
(void) handle;
(void) non_blocking;
return SANE_STATUS_UNSUPPORTED;
}
@ -1401,8 +1401,8 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int *fd)
{
handle = handle;
fd = fd;
(void) handle;
(void) fd;
return SANE_STATUS_UNSUPPORTED;
}

Wyświetl plik

@ -1,5 +1,5 @@
/* sane - Scanner Access Now Easy.
Copyright (C) 1998 David F. Skoll
Copyright (C) 1998 Dianne Skoll
This file is part of the SANE package.
This program is free software; you can redistribute it and/or

Wyświetl plik

@ -3,7 +3,7 @@
This file implements a SANE backend for the Fujitsu fi-60F, the
ScanSnap S300/S1300, and (hopefully) other Epson-based scanners.
Copyright 2007-2015 by m. allan noah <kitno455 at gmail dot com>
Copyright 2007-2022 by m. allan noah <kitno455 at gmail dot com>
Copyright 2009 by Richard Goedeken <richard at fascinationsoftware dot com>
Development funded by Microdea, Inc., TrueCheck, Inc. and Archivista, GmbH
@ -155,6 +155,10 @@
v31 2017-04-09, MAN
- hardware gray support for fi-60F/65F (disabled pending calibration)
- merge fi-60F/65F settings
v32 2022-11-15, MAN
- fix hanging scan when using source = ADF Back (fixes #601)
v33 2022-11-17, MAN
- S1300i: fix color plane offset at 225 and 330 dpi (fixes #538)
SANE FLOW DIAGRAM
@ -203,8 +207,14 @@
#include "epjitsu-cmd.h"
#define DEBUG 1
#define BUILD 31
#define BUILD 33
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifndef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
#ifndef MAX3
#define MAX3(a,b,c) ((a) > (b) ? ((a) > (c) ? a : c) : ((b) > (c) ? b : c))
#endif
@ -265,16 +275,16 @@ static struct scanner *scanner_devList = NULL;
SANE_Status
sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
{
authorize = authorize; /* get rid of compiler warning */
(void) authorize; /* get rid of compiler warning */
DBG_INIT ();
DBG (10, "sane_init: start\n");
if (version_code)
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, BUILD);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD);
DBG (5, "sane_init: epjitsu backend %d.%d.%d, from %s\n",
SANE_CURRENT_MAJOR, V_MINOR, BUILD, PACKAGE_STRING);
SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD, PACKAGE_STRING);
DBG (10, "sane_init: finish\n");
@ -317,7 +327,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
int num_devices=0;
int i=0;
local_only = local_only; /* get rid of compiler warning */
(void) local_only; /* get rid of compiler warning */
DBG (10, "sane_get_devices: start\n");
@ -1137,7 +1147,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option)
/* values stored in 1200 dpi units */
/* must be converted to MM for sane */
s->tl_x_range.min = SCANNER_UNIT_TO_FIXED_MM(0);
s->tl_x_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_width(s)-s->min_x);
s->tl_x_range.max = SCANNER_UNIT_TO_FIXED_MM(MAX(0, get_page_width(s)-s->min_x));
s->tl_x_range.quant = MM_PER_UNIT_FIX;
opt->name = SANE_NAME_SCAN_TL_X;
@ -1156,7 +1166,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option)
/* values stored in 1200 dpi units */
/* must be converted to MM for sane */
s->tl_y_range.min = SCANNER_UNIT_TO_FIXED_MM(0);
s->tl_y_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_height(s)-s->min_y);
s->tl_y_range.max = SCANNER_UNIT_TO_FIXED_MM(MAX(0, get_page_height(s)-s->min_y));
s->tl_y_range.quant = MM_PER_UNIT_FIX;
opt->name = SANE_NAME_SCAN_TL_Y;
@ -1174,7 +1184,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option)
/* values stored in 1200 dpi units */
/* must be converted to MM for sane */
s->br_x_range.min = SCANNER_UNIT_TO_FIXED_MM(s->min_x);
s->br_x_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_width(s));
s->br_x_range.max = SCANNER_UNIT_TO_FIXED_MM(MAX(s->min_x, get_page_width(s)));
s->br_x_range.quant = MM_PER_UNIT_FIX;
opt->name = SANE_NAME_SCAN_BR_X;
@ -1193,7 +1203,7 @@ sane_get_option_descriptor (SANE_Handle handle, SANE_Int option)
/* values stored in 1200 dpi units */
/* must be converted to MM for sane */
s->br_y_range.min = SCANNER_UNIT_TO_FIXED_MM(s->min_y);
s->br_y_range.max = SCANNER_UNIT_TO_FIXED_MM(get_page_height(s));
s->br_y_range.max = SCANNER_UNIT_TO_FIXED_MM(MAX(s->min_y, get_page_height(s)));
s->br_y_range.quant = MM_PER_UNIT_FIX;
opt->name = SANE_NAME_SCAN_BR_Y;
@ -2042,14 +2052,12 @@ change_params(struct scanner *s)
/* height */
if (s->tl_y > s->max_y - s->min_y)
s->tl_y = s->max_y - s->min_y - s->adf_height_padding;
if (s->tl_y + s->page_height > s->max_y - s->adf_height_padding)
s->page_height = s->max_y - s->adf_height_padding - s->tl_y;
if (s->page_height < s->min_y && s->page_height > 0)
s->page_height = s->min_y;
s->page_height = MIN(s->page_height, s->max_y - s->adf_height_padding - s->tl_y);
if (s->page_height > 0)
s->page_height = MAX(s->page_height, s->min_y);
if (s->tl_y + s->page_height > s->max_y)
s->tl_y = s->max_y - s->adf_height_padding - s->page_height;
if (s->tl_y < 0)
s->tl_y = 0;
s->tl_y = MAX(s->tl_y, 0);
if (s->page_height > 0) {
s->br_y = s->tl_y + s->page_height;
@ -2059,10 +2067,9 @@ change_params(struct scanner *s)
}
/*width*/
if (s->page_width > s->max_x)
s->page_width = s->max_x;
else if (s->page_width < s->min_x)
s->page_width = s->min_x;
s->page_width = MIN(s->page_width, s->max_x);
s->page_width = MAX(s->page_width, s->min_x);
s->tl_x = (s->max_x - s->page_width)/2;
s->br_x = (s->max_x + s->page_width)/2;
@ -2177,7 +2184,7 @@ change_params(struct scanner *s)
/* adf with specified paper size */
s->front.height = SCANNER_UNIT_TO_PIX(s->page_height, s->front.y_res);
}
s->front.width_pix = s->block_img.width_pix;
s->front.width_pix = SCANNER_UNIT_TO_PIX(s->page_width, s->resolution * img_heads);
s->front.x_start_offset = (s->block_xfr.image->width_pix - s->front.width_pix)/2;
switch (s->mode) {
case MODE_COLOR:
@ -2310,12 +2317,8 @@ load_lut (unsigned char * lut,
for(i=0;i<=max_in_val;i++){
j = rise*i + shift;
if(j<out_min){
j=out_min;
}
else if(j>out_max){
j=out_max;
}
j = MAX(j, out_min);
j = MIN(j, out_max);
*lut_p=j;
lut_p++;
@ -2654,7 +2657,7 @@ coarsecal_send_cal(struct scanner *s, unsigned char *pay)
unsigned char stat[1];
size_t cmdLen,statLen,payLen;
DBG (5, "coarsecal_send_cal: start\n");
DBG (10, "coarsecal_send_cal: start\n");
/* send coarse cal (c6) */
cmd[0] = 0x1b;
cmd[1] = 0xc6;
@ -2697,7 +2700,7 @@ coarsecal_send_cal(struct scanner *s, unsigned char *pay)
return SANE_STATUS_IO_ERROR;
}
DBG (5, "coarsecal_send_cal: finish\n");
DBG (10, "coarsecal_send_cal: finish\n");
return ret;
}
@ -2709,7 +2712,7 @@ coarsecal_get_line(struct scanner *s, struct image *img)
unsigned char stat[1];
size_t cmdLen,statLen;
DBG (5, "coarsecal_get_line: start\n");
DBG (10, "coarsecal_get_line: start\n");
/* send scan d2 command */
cmd[0] = 0x1b;
@ -2746,7 +2749,7 @@ coarsecal_get_line(struct scanner *s, struct image *img)
/* convert the raw data into normal packed pixel data */
descramble_raw(s, &s->cal_image);
DBG (5, "coarsecal_get_line: finish\n");
DBG (10, "coarsecal_get_line: finish\n");
return ret;
}
@ -2758,7 +2761,7 @@ coarsecal_dark(struct scanner *s, unsigned char *pay)
int try_count, cal_good[2], x, j;
int param[2], zcount[2], high_param[2], low_param[2], avg[2], maxval[2];
DBG (5, "coarsecal_dark: start\n");
DBG (10, "coarsecal_dark: start\n");
/* dark cal, lamp off */
ret = lamp(s,0);
@ -2844,7 +2847,7 @@ coarsecal_dark(struct scanner *s, unsigned char *pay)
} /* continue looping for up to 8 tries */
DBG (5, "coarsecal_dark: finish\n");
DBG (10, "coarsecal_dark: finish\n");
return ret;
}
@ -2857,7 +2860,7 @@ coarsecal_light(struct scanner *s, unsigned char *pay)
int param[2], zcount[2], high_param[2], low_param[2], avg[2];
int rgb_avg[2][3], rgb_hicount[2][3];
DBG (5, "coarsecal_light: start\n");
DBG (10, "coarsecal_light: start\n");
/* light cal, lamp on */
ret = lamp(s,1);
@ -2961,7 +2964,7 @@ coarsecal_light(struct scanner *s, unsigned char *pay)
}
}
DBG (5, "coarsecal_light: finish\n");
DBG (10, "coarsecal_light: finish\n");
return ret;
}
@ -3023,6 +3026,8 @@ finecal_send_cal(struct scanner *s)
unsigned char *p_out, *p_in = s->sendcal.buffer;
int planes;
DBG (10, "finecal_send_cal: start\n");
if(s->model == MODEL_FI60F || s->model == MODEL_FI65F)
planes = 3;
if(s->model == MODEL_S300 || s->model == MODEL_S1300i)
@ -3165,6 +3170,7 @@ finecal_send_cal(struct scanner *s)
return SANE_STATUS_IO_ERROR;
}
DBG (10, "finecal_send_cal: finish\n");
return ret;
}
@ -3182,6 +3188,8 @@ finecal_get_line(struct scanner *s, struct image *img)
int round_offset = img->height / 2;
int i, j, k;
DBG (10, "finecal_get_line: start\n");
/* ask for 16 lines */
ret = set_window(s, WINDOW_FINECAL);
if(ret){
@ -3238,6 +3246,8 @@ finecal_get_line(struct scanner *s, struct image *img)
avgpix[j] = (total + round_offset) / img->height;
}
}
DBG (10, "finecal_get_line: finish\n");
return ret;
}
@ -3385,8 +3395,8 @@ finecal(struct scanner *s)
else
s->sendcal.buffer[idx * 2 + 1] = newgain;
/* update statistics */
if (pixvalue < min_value[i][k]) min_value[i][k] = pixvalue;
if (pixvalue > max_value[i][k]) max_value[i][k] = pixvalue;
min_value[i][k] = MIN(min_value[i][k], pixvalue);
max_value[i][k] = MAX(max_value[i][k], pixvalue);
avg_value[i][k] += pixerror;
variance[i][k] += (pixerror * pixerror);
idx++;
@ -3658,13 +3668,8 @@ send_lut (struct scanner *s)
for(i=0;i<width;i++){
j=slope*i + offset + b;
if(j<0){
j=0;
}
if(j>(height-1)){
j=height-1;
}
j = MAX(j, 0);
j = MIN(j, height-1);
if (s->model == MODEL_S1100){
/*only one table, be order*/
@ -4078,9 +4083,7 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len
}
*len = page->bytes_scanned - page->bytes_read;
if(*len > max_len){
*len = max_len;
}
*len = MIN(*len, max_len);
if(*len){
DBG (10, "sane_read: copy rx:%d tx:%d tot:%d len:%d\n",
@ -4088,12 +4091,12 @@ sane_read (SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len
memcpy(buf, page->image->buffer + page->bytes_read, *len);
page->bytes_read += *len;
}
/* sent it all, return eof on next read */
if(page->bytes_read == page->bytes_scanned && s->fullscan.done){
DBG (10, "sane_read: side done\n");
page->done = 1;
}
/* sent it all, return eof on next read */
if(page->bytes_read == page->bytes_scanned && s->fullscan.done){
DBG (10, "sane_read: side done\n");
page->done = 1;
}
DBG (10, "sane_read: finish si:%d len:%d max:%d\n",s->side,*len,max_len);
@ -4161,6 +4164,7 @@ descramble_raw(struct scanner *s, struct transfer * tp)
for (j = 0; j < height; j++){ /* row (y)*/
int curr_col = 0;
int r=0, g=0, b=0, ppc=0;
int g_offset=0, b_offset=0;
for (k = 0; k <= tp->plane_width; k++){ /* column (x) */
int this_col = k*tp->image->x_res/tp->x_res;
@ -4185,14 +4189,20 @@ descramble_raw(struct scanner *s, struct transfer * tp)
break;
}
/* if we're using an S1300i with scan resolution 225 or 300, on AC power, the color planes are shifted */
if(s->model == MODEL_S1300i && !s->usb_power && (tp->x_res == 225 || tp->x_res == 300) && tp != &s->cal_image && k + 2 <= tp->plane_width){
g_offset = 3;
b_offset = 6;
}
/*red is first*/
r += tp->raw_data[j*tp->line_stride + k*3 + i];
/*green is second*/
g += tp->raw_data[j*tp->line_stride + tp->plane_stride + k*3 + i];
g += tp->raw_data[j*tp->line_stride + tp->plane_stride + k*3 + i + g_offset];
/*blue is third*/
b += tp->raw_data[j*tp->line_stride + 2*tp->plane_stride + k*3 + i];
b += tp->raw_data[j*tp->line_stride + 2*tp->plane_stride + k*3 + i + b_offset];
ppc++;
}
@ -4341,8 +4351,8 @@ read_from_scanner(struct scanner *s, struct transfer * tp)
size_t bufLen;
/* determine amount to ask for, S1300i wants big requests */
if(bytes > remainBlock && s->model != MODEL_S1300i){
bytes = remainBlock;
if(s->model != MODEL_S1300i){
bytes = MIN(bytes, remainBlock);
}
if (tp->image == NULL)
@ -4932,8 +4942,7 @@ maxStringSize (const SANE_String_Const strings[])
for (i = 0; strings[i]; ++i) {
size = strlen (strings[i]) + 1;
if (size > max_size)
max_size = size;
max_size = MAX(max_size, size);
}
return max_size;

Wyświetl plik

@ -2653,7 +2653,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
size_t len;
FILE *fp;
authorize = authorize; /* get rid of compiler warning */
(void) authorize; /* get rid of compiler warning */
/* sanei_authorization(devicename, STRINGIFY(BACKEND_NAME), auth_callback); */
@ -2663,7 +2663,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
#endif
if (version_code != NULL)
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, SANE_EPSON_BUILD);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, SANE_EPSON_BUILD);
sanei_usb_init ();
@ -2753,7 +2753,7 @@ sane_get_devices (const SANE_Device * **device_list, SANE_Bool local_only)
DBG (5, "sane_get_devices()\n");
local_only = local_only; /* just to get rid of the compiler warning */
(void) local_only; /* just to get rid of the compiler warning */
if (devlist)
{
@ -6383,8 +6383,8 @@ SANE_Status
sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
{
/* get rid of compiler warning */
handle = handle;
non_blocking = non_blocking;
(void) handle;
(void) non_blocking;
return SANE_STATUS_UNSUPPORTED;
}
@ -6399,8 +6399,8 @@ SANE_Status
sane_get_select_fd (SANE_Handle handle, SANE_Int * fd)
{
/* get rid of compiler warnings */
handle = handle;
fd = fd;
(void) handle;
(void) fd;
return SANE_STATUS_UNSUPPORTED;
}

Wyświetl plik

@ -77,7 +77,8 @@ e2_send(Epson_Scanner * s, void *buf, size_t buf_size, size_t reply_len,
if (reply_len == 0) {
DBG(0,
"Cannot send this command to a networked scanner\n");
return SANE_STATUS_INVAL;
*status = SANE_STATUS_INVAL;
return 0; /* nothing actually sent */
}
return sanei_epson_net_write(s, 0x2000, buf, buf_size,
reply_len, status);

Wyświetl plik

@ -291,14 +291,14 @@ e2_dev_post_init(struct Epson_Device *dev)
dev->need_reset_on_source_change = SANE_FALSE;
if (e2_dev_model(dev, "ES-9000H") || e2_dev_model(dev, "GT-30000")) {
dev->cmd->set_focus_position = 0;
dev->focusSupport = SANE_FALSE;
dev->cmd->feed = 0x19;
}
if (e2_dev_model(dev, "GT-8200") || e2_dev_model(dev, "Perfection1650")
|| e2_dev_model(dev, "Perfection1640") || e2_dev_model(dev, "GT-8700")) {
dev->focusSupport = SANE_FALSE;
dev->cmd->feed = 0;
dev->cmd->set_focus_position = 0;
dev->need_reset_on_source_change = SANE_TRUE;
}
@ -588,7 +588,7 @@ e2_discover_capabilities(Epson_Scanner *s)
/* ESC F, request status */
status = esci_request_status(s, &scanner_status);
if (status != SANE_STATUS_GOOD)
return status;;
return status;
/* set capabilities */
if (scanner_status & STATUS_OPTION)
@ -817,20 +817,17 @@ e2_discover_capabilities(Epson_Scanner *s)
DBG(1, "maximum supported color depth: %d\n", dev->maxDepth);
/*
* Check for "request focus position" command. If this command is
* supported, then the scanner does also support the "set focus
* position" command.
* XXX ???
* We assume that setting focus is supported when we can get the focus.
* This assumption may be overridden in e2_dev_post_init()
*/
if (esci_request_focus_position(s, &s->currentFocusPosition) ==
SANE_STATUS_GOOD) {
DBG(1, "setting focus is supported, current focus: %u\n", s->currentFocusPosition);
DBG(1, "getting focus is supported, current focus: %u\n", s->currentFocusPosition);
dev->focusSupport = SANE_TRUE;
s->opt[OPT_FOCUS_POS].cap &= ~SANE_CAP_INACTIVE;
s->val[OPT_FOCUS_POS].w = s->currentFocusPosition;
} else {
DBG(1, "setting focus is not supported\n");
DBG(1, "getting focus is not supported\n");
dev->focusSupport = SANE_FALSE;
s->opt[OPT_FOCUS_POS].cap |= SANE_CAP_INACTIVE;
s->val[OPT_FOCUS_POS].w = FOCUS_ON_GLASS; /* just in case */
@ -1596,7 +1593,7 @@ e2_check_adf(Epson_Scanner * s)
status = esci_request_extended_status(s, &buf, NULL);
if (status != SANE_STATUS_GOOD)
return status;;
return status;
t = buf[1];
@ -1649,11 +1646,23 @@ e2_start_ext_scan(Epson_Scanner * s)
if (buf[0] != STX)
return SANE_STATUS_INVAL;
if (buf[1] & 0x80) {
if (buf[1] & STATUS_FER) {
DBG(1, "%s: fatal error\n", __func__);
return SANE_STATUS_IO_ERROR;
}
/*
* The 12000XL signals busy only with FS+G, all other status queries
* say non-busy. Probably because you can in deed communicate with the
* device, just scanning is not yet possible. I tried polling with FS+G
* every 5 seconds, but that made scary noises. So, bail out and let
* the user retry manually.
*/
if (buf[1] & STATUS_NOT_READY) {
DBG(1, "%s: device not ready\n", __func__);
return SANE_STATUS_DEVICE_BUSY;
}
s->ext_block_len = le32atoh(&buf[2]);
s->ext_blocks = le32atoh(&buf[6]);
s->ext_last_len = le32atoh(&buf[10]);
@ -1765,10 +1774,16 @@ e2_ext_read(struct Epson_Scanner *s)
return status;
}
if (e2_dev_model(dev, "GT-8200") || e2_dev_model(dev, "Perfection1650")) {
/* See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597922#127 */
s->buf[buf_len] &= 0xc0;
}
/* Some scanners wrongly set FSG_STATUS_CANCEL_REQ. Mask it out.
* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597922#127
* https://gitlab.com/sane-project/backends/-/issues/716
*/
if (e2_dev_model(dev, "GT-8200") || e2_dev_model(dev, "Perfection1650") ||
e2_dev_model(dev, "GT-10000") || e2_dev_model(dev, "ES-6000") ||
e2_dev_model(dev, "Perfection610") || e2_dev_model(dev, "GT-6600") ||
e2_dev_model(dev, "Perfection1200") || e2_dev_model(dev, "GT-7600") ||
e2_dev_model(dev, "Expression1600") || e2_dev_model(dev, "ES-2000"))
s->buf[buf_len] &= FSG_STATUS_FER | FSG_STATUS_NOT_READY;
if (s->buf[buf_len] & FSG_STATUS_CANCEL_REQ) {
DBG(0, "%s: cancel request received\n", __func__);

Wyświetl plik

@ -15,10 +15,6 @@
* published by the Free Software Foundation, version 2.
*/
#define EPSON2_VERSION 1
#define EPSON2_REVISION 0
#define EPSON2_BUILD 124
/* debugging levels:
*
* 127 e2_recv buffer
@ -900,16 +896,14 @@ SANE_Status
sane_init(SANE_Int *version_code, SANE_Auth_Callback __sane_unused__ authorize)
{
DBG_INIT();
DBG(2, "%s: " PACKAGE " " VERSION "\n", __func__);
DBG(1, "%s: version " VERSION "\n", __func__);
DBG(1, "epson2 backend, version %i.%i.%i\n",
EPSON2_VERSION, EPSON2_REVISION, EPSON2_BUILD);
if (version_code != NULL)
*version_code = SANE_VERSION_CODE(SANE_CURRENT_MAJOR, V_MINOR,
EPSON2_BUILD);
/* Keep '124' as our build version. The arg is obsolete by now */
if (version_code)
*version_code = SANE_VERSION_CODE(SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, 124);
sanei_usb_init();
sanei_usb_set_timeout(60 * 1000);
return SANE_STATUS_GOOD;
}
@ -2303,21 +2297,6 @@ sane_start(SANE_Handle handle)
return status;
}
static inline int
get_color(int status)
{
switch ((status >> 2) & 0x03) {
case 1:
return 1;
case 2:
return 0;
case 3:
return 2;
default:
return 0; /* required to make the compiler happy */
}
}
/* this moves data from our buffers to SANE */
SANE_Status
@ -2354,7 +2333,7 @@ sane_read(SANE_Handle handle, SANE_Byte *data, SANE_Int max_length,
/* XXX if FS G and STATUS_IOERR, use e2_check_extended_status */
DBG(18, "moving data %p %p, %d (%d lines)\n",
s->ptr, s->end,
(void *) s->ptr, (void *) s->end,
max_length, max_length / s->params.bytes_per_line);
e2_copy_image_data(s, data, max_length, length);

Wyświetl plik

@ -70,7 +70,7 @@ sanei_epson_net_read_buf(Epson_Scanner *s, unsigned char *buf, ssize_t wanted,
ssize_t read = 0;
DBG(23, "%s: reading up to %lu from buffer at %p, %lu available\n",
__func__, (u_long) wanted, s->netptr, (u_long) s->netlen);
__func__, (u_long) wanted, (void *) s->netptr, (u_long) s->netlen);
if ((size_t) wanted > s->netlen) {
*status = SANE_STATUS_IO_ERROR;
@ -84,7 +84,7 @@ sanei_epson_net_read_buf(Epson_Scanner *s, unsigned char *buf, ssize_t wanted,
s->netlen -= read;
if (s->netlen == 0) {
DBG(23, "%s: freeing %p\n", __func__, s->netbuf);
DBG(23, "%s: freeing %p\n", __func__, (void *) s->netbuf);
free(s->netbuf);
s->netbuf = s->netptr = NULL;
s->netlen = 0;
@ -179,7 +179,7 @@ sanei_epson_net_write(Epson_Scanner *s, unsigned int cmd, const unsigned char *b
if (reply_len) {
if (s->netbuf) {
DBG(23, "%s, freeing %p, %ld bytes unprocessed\n",
__func__, s->netbuf, (u_long) s->netlen);
__func__, (void *) s->netbuf, (u_long) s->netlen);
free(s->netbuf);
s->netbuf = s->netptr = NULL;
s->netlen = 0;
@ -192,11 +192,11 @@ sanei_epson_net_write(Epson_Scanner *s, unsigned int cmd, const unsigned char *b
}
s->netlen = reply_len;
DBG(24, "%s: allocated %lu bytes at %p\n", __func__,
(u_long) s->netlen, s->netbuf);
(u_long) s->netlen, (void *) s->netbuf);
}
DBG(24, "%s: cmd = %04x, buf = %p, buf_size = %lu, reply_len = %lu\n",
__func__, cmd, buf, (u_long) buf_size, (u_long) reply_len);
__func__, cmd, (void *) buf, (u_long) buf_size, (u_long) reply_len);
memset(h1, 0x00, 12);
memset(h2, 0x00, 8);

Wyświetl plik

@ -27,8 +27,8 @@ sanei_epson2_scsi_sense_handler(int scsi_fd,
unsigned char *result, void *arg)
{
/* to get rid of warnings */
scsi_fd = scsi_fd;
arg = arg;
(void) scsi_fd;
(void) arg;
if (result[0] && result[0] != 0x70) {
DBG(2, "%s: sense code = 0x%02x\n",

Wyświetl plik

@ -5,184 +5,194 @@
/* generated with epson2usb.pl doc/descriptions/epson2.desc */
SANE_Word sanei_epson_usb_product_ids[] = {
0x101, /* GT-7000U, Perfection 636U */
0x103, /* GT-6600U, Perfection 610 */
0x104, /* GT-7600U, GT-7600UF, Perfection 1200U, Perfection 1200U PHOTO */
0x105, /* Stylus Scan 2000 */
0x106, /* Stylus Scan 2500 */
0x107, /* ES-2000, Expression 1600 */
0x109, /* ES-8500, Expression 1640XL */
0x10a, /* GT-8700, GT-8700F, Perfection 1640SU, Perfection 1640SU PHOTO */
0x10b, /* GT-7700U, Perfection 1240U */
0x10c, /* GT-6700U, Perfection 640U */
0x10e, /* ES-2200, Expression 1680 */
0x110, /* GT-8200U, GT-8200UF, Perfection 1650, Perfection 1650 PHOTO */
0x1116, /* XP-243 245 247 Series, XP-427 */
0x112, /* GT-9700F, Perfection 2450 PHOTO */
0x0101, /* GT-7000U, Perfection 636U */
0x0103, /* GT-6600U, Perfection 610 */
0x0104, /* GT-7600U, GT-7600UF, Perfection 1200U, Perfection 1200U PHOTO */
0x0105, /* Stylus Scan 2000 */
0x0106, /* Stylus Scan 2500 */
0x0107, /* ES-2000, Expression 1600 */
0x0109, /* ES-8500, Expression 1640XL */
0x010a, /* GT-8700, GT-8700F, Perfection 1640SU, Perfection 1640SU PHOTO */
0x010b, /* GT-7700U, Perfection 1240U */
0x010c, /* GT-6700U, Perfection 640U */
0x010e, /* ES-2200, Expression 1680 */
0x0110, /* GT-8200U, GT-8200UF, Perfection 1650, Perfection 1650 PHOTO */
0x0112, /* GT-9700F, Perfection 2450 PHOTO */
0x011b, /* GT-9300UF, Perfection 2400 PHOTO */
0x011c, /* GT-9800F, Perfection 3200 PHOTO */
0x011e, /* GT-8300UF, Perfection 1660 PHOTO */
0x0126, /* ES-7000H, GT-15000 */
0x0128, /* GT-X700, Perfection 4870 PHOTO */
0x0129, /* ES-10000G, Expression 10000XL */
0x012a, /* GT-X800, Perfection 4990 PHOTO */
0x012b, /* ES-H300, GT-2500 */
0x012c, /* GT-X900, Perfection V700 Photo, Perfection V750 Photo */
0x0135, /* GT-X970 */
0x0138, /* ES-H7200, GT-20000 */
0x014b, /* ES-G11000, Expression 11000XL */
0x0151, /* GT-X980, Perfection V800 Photo, Perfection V850 Pro */
0x015b, /* DS-G20000, Expression 12000XL */
0x0801, /* CC-600PX, Stylus CX5100, Stylus CX5200 */
0x0802, /* CC-570L, Stylus CX3100, Stylus CX3200 */
0x0805, /* Stylus CX6300, Stylus CX6400 */
0x0806, /* PM-A850, Stylus Photo RX600 */
0x0807, /* Stylus Photo RX500, Stylus Photo RX510 */
0x0808, /* Stylus CX5300, Stylus CX5400 */
0x080d, /* Stylus CX4500, Stylus CX4600 */
0x080e, /* PX-A550, Stylus CX3500, Stylus CX3600, Stylus CX3650 */
0x080f, /* Stylus Photo RX420, Stylus Photo RX425, Stylus Photo RX430 */
0x0810, /* PM-A900, Stylus Photo RX700 */
0x0811, /* PM-A870, Stylus Photo RX620, Stylus Photo RX630 */
0x0813, /* Stylus CX6500, Stylus CX6600 */
0x0814, /* PM-A700 */
0x0815, /* AcuLaser CX11, AcuLaser CX11NF, LP-A500 */
0x0817, /* LP-M5500, LP-M5500F */
0x0818, /* Stylus CX3700, Stylus CX3800, Stylus CX3810, Stylus DX3800 */
0x0819, /* PX-A650, Stylus CX4700, Stylus CX4800, Stylus DX4800, Stylus DX4850 */
0x081a, /* PM-A750, Stylus Photo RX520, Stylus Photo RX530 */
0x081c, /* PM-A890, Stylus Photo RX640, Stylus Photo RX650 */
0x081d, /* PM-A950 */
0x081f, /* Stylus CX7700, Stylus CX7800 */
0x0820, /* Stylus CX4100, Stylus CX4200, Stylus DX4200 */
0x0827, /* PM-A820, Stylus Photo RX560, Stylus Photo RX580, Stylus Photo RX590 */
0x0828, /* PM-A970 */
0x0829, /* PM-T990 */
0x082a, /* PM-A920 */
0x082b, /* Stylus CX4900, Stylus CX5000, Stylus DX5000 */
0x082e, /* PX-A720, Stylus CX5900, Stylus CX6000, Stylus DX6000 */
0x082f, /* PX-A620, Stylus CX3900, Stylus DX4000 */
0x0830, /* ME 200, Stylus CX2800, Stylus CX2900 */
0x0833, /* LP-M5600 */
0x0834, /* LP-M6000 */
0x0835, /* AcuLaser CX21 */
0x0836, /* PM-T960 */
0x0837, /* PM-A940, Stylus Photo RX680, Stylus Photo RX685, Stylus Photo RX690 */
0x0838, /* PX-A640, Stylus CX7300, Stylus CX7400, Stylus DX7400 */
0x0839, /* PX-A740, Stylus CX8300, Stylus CX8400, Stylus DX8400 */
0x083a, /* PX-FA700, Stylus CX9300F, Stylus CX9400Fax, Stylus DX9400F */
0x083c, /* PM-A840, PM-A840S, Stylus Photo RX585, Stylus Photo RX595, Stylus Photo RX610 */
0x0841, /* ME 300, PX-401A, Stylus NX100, Stylus SX100, Stylus TX100 */
0x0843, /* LP-M5000 */
0x0844, /* Artisan 800, EP-901A, EP-901F, Stylus Photo PX800FW, Stylus Photo TX800FW */
0x0846, /* Artisan 700, EP-801A, Stylus Photo PX700W, Stylus Photo TX700W */
0x0847, /* ME Office 700FW, PX-601F, Stylus Office BX600FW, Stylus Office TX600FW, Stylus SX600FW, WorkForce 600 */
0x0848, /* ME Office 600F, Stylus Office BX300F, Stylus Office TX300F, Stylus NX300 Series */
0x0849, /* Stylus NX200, Stylus SX200, Stylus SX205, Stylus TX200, Stylus TX203, Stylus TX209 */
0x084a, /* PX-501A, Stylus NX400, Stylus SX400, Stylus SX405, Stylus TX400 */
0x084c, /* WorkForce 500 */
0x084d, /* PX-402A, Stylus NX110 Series, Stylus SX110 Series, Stylus TX110 Series */
0x084f, /* ME OFFICE 510, Stylus NX210 Series, Stylus SX210 Series, Stylus TX210 Series */
0x0850, /* EP-702A, Stylus Photo PX650 Series, Stylus Photo TX650 Series */
0x0851, /* Stylus NX410 Series, Stylus SX410 Series, Stylus TX410 Series */
0x0852, /* Artisan 710 Series, EP-802A, Stylus Photo PX710W Series, Stylus Photo TX710W Series */
0x0853, /* Artisan 810 Series, EP-902A, Stylus Photo PX810FW Series */
0x0854, /* ME OFFICE 650FN Series, Stylus Office BX310FN Series, Stylus Office TX510FN Series, WorkForce 310 Series */
0x0855, /* PX-602F, Stylus Office BX610FW Series, Stylus Office TX610FW Series, Stylus SX610FW Series, WorkForce 610 Series */
0x0856, /* PX-502A, Stylus NX510 Series, Stylus SX510W Series, Stylus TX550W Series */
0x085c, /* ME 320 Series, ME 330 Series, Stylus NX125, Stylus NX127, Stylus SX125, Stylus TX120 Series */
0x085d, /* ME OFFICE 960FWD Series, PX-603F, Stylus Office BX625FWD, Stylus Office TX620FWD Series, Stylus SX620FW Series, WorkForce 630 Series */
0x085e, /* ME OFFICE 900WD Series, PX-503A, Stylus Office BX525WD, Stylus NX625, Stylus SX525WD, Stylus TX560WD Series, WorkForce 625 */
0x085f, /* Stylus Office BX320FW Series, Stylus Office TX525FW, WorkForce 520 Series */
0x0860, /* Artisan 835, EP-903A, EP-903F, Stylus Photo PX820FWD Series, Stylus Photo TX820FWD Series */
0x0861, /* Artisan 725, EP-803A, EP-803AW, Stylus Photo PX720WD Series, Stylus Photo TX720WD Series */
0x0862, /* EP-703A, Stylus Photo PX660 Series */
0x0863, /* ME OFFICE 620F Series, Stylus Office BX305F, Stylus Office BX305FW, Stylus Office TX320F Series, WorkForce 320 Series */
0x0864, /* ME OFFICE 560W Series, Stylus NX420 Series, Stylus SX420W Series, Stylus TX420W Series */
0x0865, /* ME OFFICE 520 Series, Stylus NX220 Series, Stylus SX218, Stylus TX220 Series */
0x0866, /* AcuLaser MX20DN, AcuLaser MX20DNF, AcuLaser MX21DNF */
0x0869, /* PX-1600F, WF-7510 Series */
0x086a, /* PX-673F, Stylus Office BX925FWD, WorkForce 840 Series */
0x0870, /* Stylus Office BX305FW Plus, WorkForce 435 */
0x0871, /* K200 Series */
0x0872, /* K300 Series, WorkForce K301 */
0x0873, /* L200 Series */
0x0878, /* Artisan 635, EP-704A */
0x0879, /* Artisan 837, EP-904A, EP-904F, Stylus Photo PX830FWD Series */
0x087b, /* Artisan 730 Series, EP-804A, EP-804AR, EP-804AW, Stylus Photo PX730WD Series, Stylus Photo TX730WD Series */
0x087c, /* PX-1700F, WF-7520 Series */
0x087d, /* PX-B750F, WP-4511, WP-4515, WP-4521, WP-4525, WP-4530 Series, WP-4540 Series */
0x087e, /* WP-4590 Series */
0x087f, /* PX-403A */
0x0880, /* ME OFFICE 570W Series, PX-434A, Stylus NX330 Series, Stylus SX430W Series, Stylus TX430W Series */
0x0881, /* ME OFFICE 535, PX-404A, Stylus SX230 Series, Stylus TX235 */
0x0883, /* ME 340 Series, Stylus NX130 Series, Stylus SX130 Series, Stylus TX130 Series */
0x0884, /* Stylus NX430W Series, Stylus SX440W Series, Stylus TX435W */
0x0885, /* Stylus NX230 Series, Stylus SX235W, Stylus TX230W Series */
0x088d, /* Epson ME 350 */
0x088f, /* Stylus Office BX635FWD, WorkForce 645 */
0x0890, /* ME OFFICE 940FW Series, Stylus Office BX630FW Series, WorkForce 545 */
0x0891, /* PX-504A, Stylus Office BX535WD, Stylus NX530 Series, Stylus NX635, Stylus SX535WD */
0x0892, /* Stylus Office BX935FWD, WorkForce 845 */
0x0893, /* EP-774A */
0x0894, /* LP-M5300 Series */
0x0895, /* PX-045A, XP-100 Series */
0x0896, /* ME-301, XP-200 Series */
0x0897, /* ME-303, PX-405A */
0x0898, /* ME-401, PX-435A, XP-300 Series, XP-400 Series */
0x0899, /* PX-605F, PX-675F, WF-3520 Series, WF-3530 Series, WF-3540 Series */
0x089a, /* EP-905F, XP-850 Series */
0x089b, /* EP-905A, XP-800 Series */
0x089c, /* EP-805A, EP-805AR, EP-805AW, XP-750 Series */
0x089d, /* XP-700 Series */
0x089e, /* EP-775A, EP-775AW, XP-600 Series */
0x089f, /* EP-705A */
0x08a0, /* ME-101 */
0x08a1, /* L210 Series, L350, L351 */
0x08a5, /* PX-505F, WF-2510 Series */
0x08a6, /* PX-535F, WF-2520 Series, WF-2530 Series, WF-2540 Series */
0x08a7, /* WP-M4525, WP-M4521, PX-K751F, WP-M4595 */
0x08a8, /* L355, L358 */
0x08a9, /* L550 Series */
0x08aa, /* M200 Series */
0x08ab, /* WF-M1560 Series */
0x08ac, /* AL-MX300DN Series, AL-MX300DNF Series */
0x08ad, /* LP-M8040, LP-M8040A, LP-M8040F */
0x08ae, /* PX-046A, XP-211, XP-212, XP-215 */
0x08af, /* PX-436A, XP-310 Series */
0x08b0, /* XP-410 Series */
0x08b3, /* EP-976A3, XP-950 Series */
0x08b4, /* EP-906F, XP-810 Series */
0x08b5, /* EP-806AB, EP-806AR, EP-806AW, XP-710 Series */
0x08b6, /* EP-776AB, EP-776AW, XP-610 Series */
0x08b7, /* EP-706A, XP-510 Series */
0x08b8, /* PX-M740F, PX-M741F, WF-3620 Series, WF-3640 Series */
0x08b9, /* PX-M5040F, PX-M5041F, WF-7610 Series, WF-7620 Series */
0x08bd, /* PX-M840F, WF-5620 Series, WF-5690 Series */
0x08be, /* WF-4630 Series, WF-4640 Series */
0x08bf, /* PX-437A, XP-320 Series */
0x08c0, /* PX-047A, XP-225 */
0x08c1, /* XP-420 Series */
0x08c3, /* PX-M650A, PX-M650F, WF-2650 Series, WF-2660 Series */
0x08c4, /* WF-2630 Series */
0x08c5, /* EP-977A3 */
0x08c6, /* EP-907F, XP-820 Series, XP-860 Series */
0x08c7, /* EP-807AB, EP-807AR, EP-807AW, XP-720 Series, XP-760 Series */
0x08c8, /* EP-777A, XP-520 Series, XP-620 Series */
0x08c9, /* EP-707A */
0x08ca, /* L850 Series */
0x08cd, /* WF-R4640 Series, WF-R5690 Series */
0x08d0, /* PX-M350F, WF-M5690 Series */
0x08d1, /* L360 Series */
0x08d2, /* L365 Series, L366 Series */
0x1102, /* PX-048A Series, XP-230 Series, XP-235 Series */
0x1105, /* ET-2500 Series, L375 Series */
0x110f, /* PX-M160T Series */
0x1116, /* XP-240 243 245 247 Series, XP-427, PX-049A Series */
0x1120, /* L380 */
0x1121, /* ET-2650, L495 */
0x1122, /* ET-2600 */
0x1122, /* ET-2600 Series, ET-2610 Series, L3050 Series, L3060 Series, L395 Series, L396 Series */
0x113d, /* XP-255 */
0x11b, /* GT-9300UF, Perfection 2400 PHOTO */
0x11c, /* GT-9800F, Perfection 3200 PHOTO */
0x11e, /* GT-8300UF, Perfection 1660 PHOTO */
0x126, /* ES-7000H, GT-15000 */
0x128, /* GT-X700, Perfection 4870 PHOTO */
0x129, /* ES-10000G, Expression 10000XL */
0x12a, /* GT-X800, Perfection 4990 PHOTO */
0x12b, /* ES-H300, GT-2500 */
0x12c, /* GT-X900, Perfection V700 Photo, Perfection V750 Photo */
0x135, /* GT-X970 */
0x138, /* ES-H7200, GT-20000 */
0x14b, /* ES-G11000, Expression 11000XL */
0x151, /* GT-X980, Perfection V800 Photo, Perfection V850 Pro */
0x15b, /* DS-G20000, Expression 12000XL */
0x801, /* CC-600PX, Stylus CX5100, Stylus CX5200 */
0x802, /* CC-570L, Stylus CX3100, Stylus CX3200 */
0x805, /* Stylus CX6300, Stylus CX6400 */
0x806, /* PM-A850, Stylus Photo RX600 */
0x807, /* Stylus Photo RX500, Stylus Photo RX510 */
0x808, /* Stylus CX5300, Stylus CX5400 */
0x80d, /* Stylus CX4500, Stylus CX4600 */
0x80e, /* PX-A550, Stylus CX3500, Stylus CX3600, Stylus CX3650 */
0x80f, /* Stylus Photo RX420, Stylus Photo RX425, Stylus Photo RX430 */
0x810, /* PM-A900, Stylus Photo RX700 */
0x811, /* PM-A870, Stylus Photo RX620, Stylus Photo RX630 */
0x813, /* Stylus CX6500, Stylus CX6600 */
0x814, /* PM-A700 */
0x815, /* AcuLaser CX11, AcuLaser CX11NF, LP-A500 */
0x817, /* LP-M5500, LP-M5500F */
0x818, /* Stylus CX3700, Stylus CX3800, Stylus CX3810, Stylus DX3800 */
0x819, /* PX-A650, Stylus CX4700, Stylus CX4800, Stylus DX4800, Stylus DX4850 */
0x81a, /* PM-A750, Stylus Photo RX520, Stylus Photo RX530 */
0x81c, /* PM-A890, Stylus Photo RX640, Stylus Photo RX650 */
0x81d, /* PM-A950 */
0x81f, /* Stylus CX7700, Stylus CX7800 */
0x820, /* Stylus CX4100, Stylus CX4200, Stylus DX4200 */
0x827, /* PM-A820, Stylus Photo RX560, Stylus Photo RX580, Stylus Photo RX590 */
0x828, /* PM-A970 */
0x829, /* PM-T990 */
0x82a, /* PM-A920 */
0x82b, /* Stylus CX4900, Stylus CX5000, Stylus DX5000 */
0x82e, /* PX-A720, Stylus CX5900, Stylus CX6000, Stylus DX6000 */
0x82f, /* PX-A620, Stylus CX3900, Stylus DX4000 */
0x830, /* ME 200, Stylus CX2800, Stylus CX2900 */
0x833, /* LP-M5600 */
0x834, /* LP-M6000 */
0x835, /* AcuLaser CX21 */
0x836, /* PM-T960 */
0x837, /* PM-A940, Stylus Photo RX680, Stylus Photo RX685, Stylus Photo RX690 */
0x838, /* PX-A640, Stylus CX7300, Stylus CX7400, Stylus DX7400 */
0x839, /* PX-A740, Stylus CX8300, Stylus CX8400, Stylus DX8400 */
0x83a, /* PX-FA700, Stylus CX9300F, Stylus CX9400Fax, Stylus DX9400F */
0x83c, /* PM-A840, PM-A840S, Stylus Photo RX585, Stylus Photo RX595, Stylus Photo RX610 */
0x841, /* ME 300, PX-401A, Stylus NX100, Stylus SX100, Stylus TX100 */
0x843, /* LP-M5000 */
0x844, /* Artisan 800, EP-901A, EP-901F, Stylus Photo PX800FW, Stylus Photo TX800FW */
0x846, /* Artisan 700, EP-801A, Stylus Photo PX700W, Stylus Photo TX700W */
0x847, /* ME Office 700FW, PX-601F, Stylus Office BX600FW, Stylus Office TX600FW, Stylus SX600FW, WorkForce 600 */
0x848, /* ME Office 600F, Stylus Office BX300F, Stylus Office TX300F, Stylus NX300 Series */
0x849, /* Stylus NX200, Stylus SX200, Stylus SX205, Stylus TX200, Stylus TX203, Stylus TX209 */
0x84a, /* PX-501A, Stylus NX400, Stylus SX400, Stylus SX405, Stylus TX400 */
0x84c, /* WorkForce 500 */
0x84d, /* PX-402A, Stylus NX110 Series, Stylus SX110 Series, Stylus TX110 Series */
0x84f, /* ME OFFICE 510, Stylus NX210 Series, Stylus SX210 Series, Stylus TX210 Series */
0x850, /* EP-702A, Stylus Photo PX650 Series, Stylus Photo TX650 Series */
0x851, /* Stylus NX410 Series, Stylus SX410 Series, Stylus TX410 Series */
0x852, /* Artisan 710 Series, EP-802A, Stylus Photo PX710W Series, Stylus Photo TX710W Series */
0x853, /* Artisan 810 Series, EP-902A, Stylus Photo PX810FW Series */
0x854, /* ME OFFICE 650FN Series, Stylus Office BX310FN Series, Stylus Office TX510FN Series, WorkForce 310 Series */
0x855, /* PX-602F, Stylus Office BX610FW Series, Stylus Office TX610FW Series, Stylus SX610FW Series, WorkForce 610 Series */
0x856, /* PX-502A, Stylus NX510 Series, Stylus SX510W Series, Stylus TX550W Series */
0x85c, /* ME 320 Series, ME 330 Series, Stylus NX125, Stylus NX127, Stylus SX125, Stylus TX120 Series */
0x85d, /* ME OFFICE 960FWD Series, PX-603F, Stylus Office BX625FWD, Stylus Office TX620FWD Series, Stylus SX620FW Series, WorkForce 630 Series */
0x85e, /* ME OFFICE 900WD Series, PX-503A, Stylus Office BX525WD, Stylus NX625, Stylus SX525WD, Stylus TX560WD Series, WorkForce 625 */
0x85f, /* Stylus Office BX320FW Series, Stylus Office TX525FW, WorkForce 520 Series */
0x860, /* Artisan 835, EP-903A, EP-903F, Stylus Photo PX820FWD Series, Stylus Photo TX820FWD Series */
0x861, /* Artisan 725, EP-803A, EP-803AW, Stylus Photo PX720WD Series, Stylus Photo TX720WD Series */
0x862, /* EP-703A, Stylus Photo PX660 Series */
0x863, /* ME OFFICE 620F Series, Stylus Office BX305F, Stylus Office BX305FW, Stylus Office TX320F Series, WorkForce 320 Series */
0x864, /* ME OFFICE 560W Series, Stylus NX420 Series, Stylus SX420W Series, Stylus TX420W Series */
0x865, /* ME OFFICE 520 Series, Stylus NX220 Series, Stylus SX218, Stylus TX220 Series */
0x866, /* AcuLaser MX20DN, AcuLaser MX20DNF, AcuLaser MX21DNF */
0x869, /* PX-1600F, WF-7510 Series */
0x86a, /* PX-673F, Stylus Office BX925FWD, WorkForce 840 Series */
0x870, /* Stylus Office BX305FW Plus, WorkForce 435 */
0x871, /* K200 Series */
0x872, /* K300 Series, WorkForce K301 */
0x873, /* L200 Series */
0x878, /* Artisan 635, EP-704A */
0x879, /* Artisan 837, EP-904A, EP-904F, Stylus Photo PX830FWD Series */
0x87b, /* Artisan 730 Series, EP-804A, EP-804AR, EP-804AW, Stylus Photo PX730WD Series, Stylus Photo TX730WD Series */
0x87c, /* PX-1700F, WF-7520 Series */
0x87d, /* PX-B750F, WP-4511, WP-4515, WP-4521, WP-4525, WP-4530 Series, WP-4540 Series */
0x87e, /* WP-4590 Series */
0x87f, /* PX-403A */
0x880, /* ME OFFICE 570W Series, PX-434A, Stylus NX330 Series, Stylus SX430W Series, Stylus TX430W Series */
0x881, /* ME OFFICE 535, PX-404A, Stylus SX230 Series, Stylus TX235 */
0x883, /* ME 340 Series, Stylus NX130 Series, Stylus SX130 Series, Stylus TX130 Series */
0x884, /* Stylus NX430W Series, Stylus SX440W Series, Stylus TX435W */
0x885, /* Stylus NX230 Series, Stylus SX235W, Stylus TX230W Series */
0x88d, /* Epson ME 350 */
0x88f, /* Stylus Office BX635FWD, WorkForce 645 */
0x890, /* ME OFFICE 940FW Series, Stylus Office BX630FW Series, WorkForce 545 */
0x891, /* PX-504A, Stylus Office BX535WD, Stylus NX530 Series, Stylus NX635, Stylus SX535WD */
0x892, /* Stylus Office BX935FWD, WorkForce 845 */
0x893, /* EP-774A */
0x894, /* LP-M5300 Series */
0x895, /* PX-045A, XP-100 Series */
0x896, /* ME-301, XP-200 Series */
0x897, /* ME-303, PX-405A */
0x898, /* ME-401, PX-435A, XP-300 Series, XP-400 Series */
0x899, /* PX-605F, PX-675F, WF-3520 Series, WF-3530 Series, WF-3540 Series */
0x89a, /* EP-905F, XP-850 Series */
0x89b, /* EP-905A, XP-800 Series */
0x89c, /* EP-805A, EP-805AR, EP-805AW, XP-750 Series */
0x89d, /* XP-700 Series */
0x89e, /* EP-775A, EP-775AW, XP-600 Series */
0x89f, /* EP-705A */
0x8a0, /* ME-101 */
0x8a1, /* L210 Series, L350, L351 */
0x8a5, /* PX-505F, WF-2510 Series */
0x8a6, /* PX-535F, WF-2520 Series, WF-2530 Series, WF-2540 Series */
0x8a7, /* WP-M4525, WP-M4521, PX-K751F, WP-M4595 */
0x8a8, /* L355, L358 */
0x8a9, /* L550 Series */
0x8aa, /* M200 Series */
0x8ab, /* WF-M1560 Series */
0x8ac, /* AL-MX300DN Series, AL-MX300DNF Series */
0x8ad, /* LP-M8040, LP-M8040A, LP-M8040F */
0x8ae, /* PX-046A, XP-211, XP-212, XP-215 */
0x8af, /* PX-436A, XP-310 Series */
0x8b0, /* XP-410 Series */
0x8b3, /* EP-976A3, XP-950 Series */
0x8b4, /* EP-906F, XP-810 Series */
0x8b5, /* EP-806AB, EP-806AR, EP-806AW, XP-710 Series */
0x8b6, /* EP-776AB, EP-776AW, XP-610 Series */
0x8b7, /* EP-706A, XP-510 Series */
0x8b8, /* PX-M740F, PX-M741F, WF-3620 Series, WF-3640 Series */
0x8b9, /* PX-M5040F, PX-M5041F, WF-7610 Series, WF-7620 Series */
0x8bd, /* PX-M840F, WF-5620 Series, WF-5690 Series */
0x8be, /* WF-4630 Series, WF-4640 Series */
0x8bf, /* PX-437A, XP-320 Series */
0x8c0, /* PX-047A, XP-225 */
0x8c1, /* XP-420 Series */
0x8c3, /* PX-M650A, PX-M650F, WF-2650 Series, WF-2660 Series */
0x8c4, /* WF-2630 Series */
0x8c5, /* EP-977A3 */
0x8c6, /* EP-907F, XP-820 Series, XP-860 Series */
0x8c7, /* EP-807AB, EP-807AR, EP-807AW, XP-720 Series, XP-760 Series */
0x8c8, /* EP-777A, XP-520 Series, XP-620 Series */
0x8c9, /* EP-707A */
0x8ca, /* L850 Series */
0x8cd, /* WF-R4640 Series, WF-R5690 Series */
0x8d0, /* PX-M350F, WF-M5690 Series */
0 /* last entry - this is used for devices that are specified
in the config file as "usb <vendor> <product>" */
0x113e, /* XP-452 455 Series */
0x1141, /* L3100 Series */
0x1142, /* L3110 Series */
0x1188, /* L3210 Series */
0x1189, /* L3200 Series */
0 /* last entry - this is used for devices that are specified
in the config file as "usb <vendor> <product>" */
};
int
sanei_epson_getNumberOfUSBProductIds (void)
sanei_epson_getNumberOfUSBProductIds(void)
{
return sizeof (sanei_epson_usb_product_ids) / sizeof (SANE_Word);
}

Wyświetl plik

@ -32,8 +32,8 @@ SANE_Status
sanei_epson_scsi_sense_handler (int scsi_fd, u_char * result, void *arg)
{
/* to get rid of warnings */
scsi_fd = scsi_fd;
arg = arg;
(void) scsi_fd;
(void) arg;
if (result[0] && result[0] != 0x70)
{

Wyświetl plik

@ -134,6 +134,7 @@ static SANE_Status esci2_cmd(epsonds_scanner* s,
SANE_Status status;
unsigned int more;
char header[13], rbuf[64]; /* add one more byte for header buffer to correct buffer overflow issue,*/
char *buf;
DBG(8, "%s: %4s len %lu, payload len: %lu\n", __func__, cmd, len, plen);
@ -151,6 +152,21 @@ static SANE_Status esci2_cmd(epsonds_scanner* s,
// send RequestBlock, request immediate response if there's no payload
status = eds_txrx(s, header, len, rbuf, (plen > 0) ? 0 : 64);
/* pointer to the token's value */
buf = rbuf + 12;
/* nrd / nrdBUSY */
DBG(8, "buf = %s\n",buf);
if (strncmp("#nrd", buf, 4) == 0) {
buf += 4;
DBG(8, "buf = %s\n",buf);
if (strncmp("BUSY", buf, 4) == 0) {
DBG(8, "device busy\n");
DBG(8, "SANE_STATUS:%d\n", SANE_STATUS_DEVICE_BUSY);
return SANE_STATUS_DEVICE_BUSY;
}
}
if (status != SANE_STATUS_GOOD) {
return status;
}
@ -227,6 +243,21 @@ SANE_Status esci2_fin(epsonds_scanner *s)
DBG(5, "%s\n", __func__);
status = esci2_cmd_simple(s, "FIN x0000000", NULL);
for(int i = 0; i < 10; i++) {
if(status == SANE_STATUS_DEVICE_BUSY || status == SANE_STATUS_IO_ERROR) {
status = esci2_cmd_simple(s, "FIN x0000000", NULL);
}
else {
DBG(1, "break\n");
break;
}
DBG(1, "sleep(5)\n");
sleep(5);
}
s->locked = 0;
return status;
}
@ -264,13 +295,13 @@ static char *decode_binary(char *buf, int len)
memcpy(tmp, buf, 4);
tmp[4] = '\0';
len -= 4;
if (buf[0] != 'h')
return NULL;
hl = strtol(tmp + 1, NULL, 16);
if (hl > len) hl = len;
if (hl > len)
hl = len;
if (hl) {
char *v = malloc(hl + 1);
@ -313,9 +344,6 @@ static SANE_Status info_cb(void *userdata, char *token, int len)
epsonds_scanner *s = (epsonds_scanner *)userdata;
char *value;
if (DBG_LEVEL >= 11) {
debug_token(DBG_LEVEL, __func__, token, len);
}
/* pointer to the token's value */
value = token + 3;
@ -333,7 +361,6 @@ static SANE_Status info_cb(void *userdata, char *token, int len)
s->hw->model = decode_string(value, len);
s->hw->sane.model = s->hw->model;
DBG(1, " product: %s\n", s->hw->model);
/* we will free the string later */
}
if (strncmp("VER", token, 3) == 0) {
@ -421,6 +448,7 @@ static SANE_Status info_cb(void *userdata, char *token, int len)
int max = decode_value(value + 4 + 8, 8);
DBG(1, " ADF: area %dx%d @ 100dpi\n", min, max);
eds_set_adf_area(s->hw, min, max, 100);
}
if (strncmp("AMIN", value, 4) == 0) {
@ -437,11 +465,40 @@ static SANE_Status info_cb(void *userdata, char *token, int len)
int max = decode_value(value + 4 + 8, 8);
DBG(1, " ADF: max %dx%d @ 100dpi\n", min, max);
}
}
if (len == 16) {
if (strncmp("AREA", value, 4) == 0) {
int min = decode_value(value + 4, 4);
int max = decode_value(value + 4 + 4, 8);
DBG(1, " ADF: area %dx%d @ 100dpi\n", min, max);
eds_set_adf_area(s->hw, min, max, 100);
}
if (strncmp("AMAX", value, 4) == 0) {
// d
int min = decode_value(value + 4, 4);
// i
int max = decode_value(value + 4 + 4, 8);
DBG(1, " ADF: max %dx%d @ 100dpi\n", min, max);
}
}
if (len == 12) {
/* RESOi0000600 */
@ -483,6 +540,22 @@ static SANE_Status info_cb(void *userdata, char *token, int len)
}
}
if (len == 16) {
/* AREAi0000850i0001400 */
if (strncmp("AREA", value, 4) == 0) {
//d
int min = decode_value(value + 4, 4);
//i
int max = decode_value(value + 4 + 4, 8);
DBG(1, " FB: area %dx%d @ 100dpi\n", min, max);
eds_set_fbf_area(s->hw, min, max, 100);
}
}
if (len == 8) {
if (strncmp("ALGNLEFT", value, len) == 0) {
@ -602,6 +675,7 @@ static SANE_Status capa_cb(void *userdata, char *token, int len)
if (strncmp("ADFCRP ", token, 3 + 4) == 0) {
DBG(1, " ADF: image cropping\n");
s->hw->adf_has_crp = 1;
}
if (strncmp("ADFFAST", token, 3 + 4) == 0) {
@ -636,6 +710,23 @@ static SANE_Status capa_cb(void *userdata, char *token, int len)
}
}
if (strncmp("COLLIST", token, 3 + 4) == 0)
{
char *p = token + 3 + 4;
int count = (len - 4);
int readBytes = 0;
s->hw->has_mono = 0;
while (readBytes < count) {
if (strncmp(p, "M001", 4) == 0)
{
s->hw->has_mono = 1;
}
readBytes+=4;
p+=4;
}
}
/* RSMRANGi0000050i0000600 */
if (strncmp("RSMRANG", token, 3 + 4) == 0) {
@ -659,17 +750,24 @@ static SANE_Status capa_cb(void *userdata, char *token, int len)
char *p = token + 3 + 4;
if (p[0] == 'i') {
int i;
int count = (len - 4) / 8;
for (i = 0; i < count; i++) {
int count = (len - 4);
int readBytes = 0;
while (readBytes < count) {
if(*p == 'i')
{
eds_add_resolution(s->hw, decode_value(p, 8));
p += 8;
readBytes += 8;
}else if(*p == 'd')
{
eds_add_resolution(s->hw, decode_value(p, 4));
p += 4;
readBytes +=4;
}
}
}
}
return SANE_STATUS_GOOD;
@ -684,16 +782,26 @@ SANE_Status esci2_capa(epsonds_scanner *s)
static SANE_Status stat_cb(void *userdata, char *token, int len)
{
/*
epsonds_scanner *s = (epsonds_scanner *)userdata;
char *value = token + 3;
*/
userdata = userdata;
(void) userdata;
if (DBG_LEVEL >= 11) {
debug_token(DBG_LEVEL, __func__, token, len);
}
if (strncmp("ERR", token, 3) == 0) {
if (strncmp("ADF PE ", value, len) == 0) {
DBG(1, " PE : paper empty\n");
return SANE_STATUS_NO_DOCS;
}
if (strncmp("ADF OPN", value, len) == 0) {
DBG(1, " conver open\n");
return SANE_STATUS_COVER_OPEN;
}
}
return SANE_STATUS_GOOD;
}
@ -708,7 +816,7 @@ static SANE_Status resa_cb(void *userdata, char *token, int len)
{
/* epsonds_scanner *s = (epsonds_scanner *)userdata; */
userdata = userdata;
(void) userdata;
if (DBG_LEVEL >= 11) {
debug_token(DBG_LEVEL, __func__, token, len);
@ -730,7 +838,7 @@ static SANE_Status para_cb(void *userdata, char *token, int len)
debug_token(DBG_LEVEL, __func__, token, len);
}
userdata = userdata;
(void) userdata;
if (strncmp("par", token, 3) == 0) {
if (strncmp("FAIL", token + 3, 4) == 0) {
@ -742,10 +850,10 @@ static SANE_Status para_cb(void *userdata, char *token, int len)
return SANE_STATUS_GOOD;
}
SANE_Status esci2_para(epsonds_scanner *s, char *parameters)
SANE_Status esci2_para(epsonds_scanner *s, char *parameters, int len)
{
DBG(8, "%s: %s\n", __func__, parameters);
return esci2_cmd(s, "PARAx0000000", 12, parameters, strlen(parameters), NULL, &para_cb);
return esci2_cmd(s, "PARAx0000000", 12, parameters, len, NULL, &para_cb);
}
SANE_Status esci2_mech(epsonds_scanner *s, char *parameters)
@ -784,12 +892,105 @@ static SANE_Status img_cb(void *userdata, char *token, int len)
return SANE_STATUS_GOOD;
}
if (len == 12 && strncmp("pst", token, 3) == 0) {
s->dummy = decode_value(token + 3 + 4, 4);
DBG(10, "%s: pst width: %d, height: %d, dummy: %d\n",
__func__,
decode_value(token + 3, 4),
decode_value(token + 3 + 4 + 4, 4),
s->dummy);
return SANE_STATUS_GOOD;
}
if (len == 16 && strncmp("pst", token, 3) == 0) {
s->dummy = decode_value(token + 3 + 4, 4);
DBG(10, "%s: pst width: %d, height: %d, dummy: %d\n",
__func__,
decode_value(token + 3, 4),
decode_value(token + 3 + 4 + 4, 8),
s->dummy);
return SANE_STATUS_GOOD;
}
if (len == 20 && strncmp("pst", token, 3) == 0) {
s->dummy = decode_value(token + 3 + 8, 4);
DBG(10, "%s: pst width: %d, height: %d, dummy: %d\n",
__func__,
decode_value(token + 3, 8),
decode_value(token + 3 + 8 + 4, 8),
s->dummy);
return SANE_STATUS_GOOD;
}
// i0001696i0002347
if (len == 16 && strncmp("pen", token, 3) == 0) {
DBG(10, "%s: page end\n", __func__);
s->eof = 1;
if (s->isflatbedScan)
{
s->scanning = 0;
}
DBG(10, "%s: pen width: %d, height: %d, dummy: %d\n",
__func__,
decode_value(token + 3, 8),
decode_value(token + 3 + 8, 8),
s->dummy);
s->width_temp = decode_value(token + 3, 8);
s->height_temp = decode_value(token + 3 + 8, 8);
return SANE_STATUS_EOF;
}
// d696i0002347
if (len == 12 && strncmp("pen", token, 3) == 0) {
DBG(10, "%s: page end\n", __func__);
s->eof = 1;
if (s->isflatbedScan)
{
s->scanning = 0;
}
DBG(10, "%s: pen width: %d, height: %d, dummy: %d\n",
__func__,
decode_value(token + 3, 4),
decode_value(token + 3 + 4, 8),
s->dummy);
s->width_temp = decode_value(token + 3, 4);
s->height_temp = decode_value(token + 3 + 4, 8);
return SANE_STATUS_EOF;
}
// d696d2347
if (len == 8 && strncmp("pen", token, 3) == 0) {
DBG(10, "%s: page end\n", __func__);
s->eof = 1;
if (s->isflatbedScan)
{
s->scanning = 0;
}
DBG(10, "%s: pen width: %d, height: %d, dummy: %d\n",
__func__,
decode_value(token + 3, 4),
decode_value(token + 3 + 4, 4),
s->dummy);
s->width_temp = decode_value(token + 3, 4);
s->height_temp = decode_value(token + 3 + 4, 4);
return SANE_STATUS_EOF;
}
/* typIMGA or typIMGB */
if (len == 4 && strncmp("typ", token, 3) == 0) {
@ -807,6 +1008,7 @@ static SANE_Status img_cb(void *userdata, char *token, int len)
char *cause = token + 3 + 4; /* OPN, PJ, PE, ERR, LTF, LOCK, DFED, DTCL, AUT, PERM */
s->scanning = 0;
s->scanEnd = 1;
DBG(1, "%s: error on option %3.3s, cause %4.4s\n",
__func__, option, cause);
@ -831,6 +1033,8 @@ static SANE_Status img_cb(void *userdata, char *token, int len)
}
if (len == 4 && strncmp("lftd000", token, 3 + 4) == 0) {
DBG(1, "%s:lft ok\n", __func__);
s->scanEnd = 1;
s->scanning = 0;
}
@ -846,6 +1050,8 @@ esci2_img(struct epsonds_scanner *s, SANE_Int *length)
unsigned int more;
ssize_t read;
DBG(15, "esci2_img start\n");
*length = 0;
if (s->canceling)
@ -856,6 +1062,7 @@ esci2_img(struct epsonds_scanner *s, SANE_Int *length)
if (status != SANE_STATUS_GOOD) {
return status;
}
DBG(15, "request img OK\n");
/* receive DataHeaderBlock */
memset(s->buf, 0x00, 64);
@ -863,6 +1070,7 @@ esci2_img(struct epsonds_scanner *s, SANE_Int *length)
if (status != SANE_STATUS_GOOD) {
return status;
}
DBG(15, "receive img OK\n");
/* check if we need to read any image data */
more = 0;
@ -873,6 +1081,17 @@ esci2_img(struct epsonds_scanner *s, SANE_Int *length)
/* this handles eof and errors */
parse_status = esci2_parse_block((char *)s->buf + 12, 64 - 12, s, &img_cb);
if (s->backside)
{
s->width_back = s->width_temp;
s->height_back = s->height_temp;
}else{
s->width_front = s->width_temp;
s->height_front = s->height_temp;
}
/* no more data? return using the status of the esci2_parse_block
* call, which might hold other error conditions.
*/
@ -884,7 +1103,6 @@ esci2_img(struct epsonds_scanner *s, SANE_Int *length)
if (more > s->bsz) {
return SANE_STATUS_IO_ERROR;
}
/* ALWAYS read image data */
if (s->hw->connection == SANE_EPSONDS_NET) {
epsonds_net_request_read(s, more);

Wyświetl plik

@ -20,7 +20,7 @@ SANE_Status esci2_can(epsonds_scanner *s);
SANE_Status esci2_capa(epsonds_scanner *s);
SANE_Status esci2_resa(epsonds_scanner *s);
SANE_Status esci2_stat(epsonds_scanner *s);
SANE_Status esci2_para(epsonds_scanner *s, char *parameters);
SANE_Status esci2_para(epsonds_scanner *s, char *parameters, int len);
SANE_Status esci2_mech(epsonds_scanner *s, char *parameters);
SANE_Status esci2_trdt(epsonds_scanner *s);
SANE_Status esci2_img(struct epsonds_scanner *s, SANE_Int *length) ;

Wyświetl plik

@ -20,19 +20,39 @@
#include "epsonds.h"
#include "epsonds-jpeg.h"
#include "epsonds-ops.h"
#include <setjmp.h>
#define min(A,B) (((A)<(B)) ? (A) : (B))
struct my_error_mgr {
struct jpeg_error_mgr pub;
jmp_buf setjmp_buffer;
};
typedef struct my_error_mgr * my_error_ptr;
METHODDEF(void) my_error_exit (j_common_ptr cinfo)
{
char buffer[JMSG_LENGTH_MAX];
(*cinfo->err->format_message) (cinfo, buffer);
DBG(10,"Jpeg decode error [%s]", buffer);
}
LOCAL(struct jpeg_error_mgr *) jpeg_custom_error (struct my_error_mgr * err)
{
struct jpeg_error_mgr* pRet = jpeg_std_error(&(err->pub));
err->pub.error_exit = my_error_exit;
return pRet;
}
typedef struct
{
struct jpeg_source_mgr pub;
epsonds_scanner *s;
JOCTET *buffer;
SANE_Byte *linebuffer;
SANE_Int linebuffer_size;
SANE_Int linebuffer_index;
int length;
}
epsonds_src_mgr;
@ -50,22 +70,11 @@ METHODDEF(boolean)
jpeg_fill_input_buffer(j_decompress_ptr cinfo)
{
epsonds_src_mgr *src = (epsonds_src_mgr *)cinfo->src;
int avail, size;
/* read from the scanner or the ring buffer */
avail = eds_ring_avail(src->s->current);
if (avail == 0) {
return FALSE;
}
/* read from scanner if no data? */
size = min(1024, avail);
eds_ring_read(src->s->current, src->buffer, size);
src->pub.next_input_byte = src->buffer;
src->pub.bytes_in_buffer = size;
src->pub.bytes_in_buffer = src->length;
DBG(18, "reading from ring buffer, %d left\n", src->length);
return TRUE;
}
@ -87,140 +96,140 @@ jpeg_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
}
}
SANE_Status
eds_jpeg_start(epsonds_scanner *s)
void eds_decode_jpeg(epsonds_scanner*s, SANE_Byte *data, SANE_Int size, ring_buffer* ringBuffer, SANE_Int isBackSide, SANE_Int needToConvertBW)
{
epsonds_src_mgr *src;
struct jpeg_decompress_struct jpeg_cinfo;
struct my_error_mgr jpeg_err;
s->jpeg_cinfo.err = jpeg_std_error(&s->jpeg_err);
{
epsonds_src_mgr *src;
jpeg_create_decompress(&s->jpeg_cinfo);
jpeg_cinfo.err = jpeg_custom_error(&jpeg_err);
s->jpeg_cinfo.src = (struct jpeg_source_mgr *)(*s->jpeg_cinfo.mem->alloc_small)((j_common_ptr)&s->jpeg_cinfo,
JPOOL_PERMANENT, sizeof(epsonds_src_mgr));
jpeg_create_decompress(&jpeg_cinfo);
memset(s->jpeg_cinfo.src, 0x00, sizeof(epsonds_src_mgr));
jpeg_cinfo.src = (struct jpeg_source_mgr *)(*jpeg_cinfo.mem->alloc_small)((j_common_ptr)&jpeg_cinfo,
JPOOL_PERMANENT, sizeof(epsonds_src_mgr));
src = (epsonds_src_mgr *)s->jpeg_cinfo.src;
src->s = s;
memset(jpeg_cinfo.src, 0x00, sizeof(epsonds_src_mgr));
;
src = (epsonds_src_mgr *)jpeg_cinfo.src;
src->pub.init_source = jpeg_init_source;
src->pub.fill_input_buffer = jpeg_fill_input_buffer;
src->pub.skip_input_data = jpeg_skip_input_data;
src->pub.resync_to_restart = jpeg_resync_to_restart;
src->pub.term_source = jpeg_term_source;
src->pub.bytes_in_buffer = 0;
src->pub.next_input_byte = NULL;
src->buffer = (JOCTET*)data;
src->length = size;
}
{
if (jpeg_read_header(&jpeg_cinfo, TRUE)) {
src->buffer = (JOCTET *)(*s->jpeg_cinfo.mem->alloc_small)((j_common_ptr)&s->jpeg_cinfo,
JPOOL_PERMANENT,
1024 * sizeof(JOCTET));
if (jpeg_start_decompress(&jpeg_cinfo)) {
src->pub.init_source = jpeg_init_source;
src->pub.fill_input_buffer = jpeg_fill_input_buffer;
src->pub.skip_input_data = jpeg_skip_input_data;
src->pub.resync_to_restart = jpeg_resync_to_restart;
src->pub.term_source = jpeg_term_source;
src->pub.bytes_in_buffer = 0;
src->pub.next_input_byte = NULL;
s->jpeg_header_seen = 0;
return SANE_STATUS_GOOD;
}
SANE_Status
eds_jpeg_read_header(epsonds_scanner *s)
{
epsonds_src_mgr *src = (epsonds_src_mgr *)s->jpeg_cinfo.src;
if (jpeg_read_header(&s->jpeg_cinfo, TRUE)) {
s->jdst = sanei_jpeg_jinit_write_ppm(&s->jpeg_cinfo);
if (jpeg_start_decompress(&s->jpeg_cinfo)) {
int size;
DBG(3, "%s: w: %d, h: %d, components: %d\n",
DBG(10,"%s: w: %d, h: %d, components: %d\n",
__func__,
s->jpeg_cinfo.output_width, s->jpeg_cinfo.output_height,
s->jpeg_cinfo.output_components);
size = s->jpeg_cinfo.output_width * s->jpeg_cinfo.output_components * 1;
src->linebuffer = (*s->jpeg_cinfo.mem->alloc_large)((j_common_ptr)&s->jpeg_cinfo,
JPOOL_PERMANENT, size);
src->linebuffer_size = 0;
src->linebuffer_index = 0;
s->jpeg_header_seen = 1;
return SANE_STATUS_GOOD;
} else {
DBG(0, "%s: decompression failed\n", __func__);
return SANE_STATUS_IO_ERROR;
jpeg_cinfo.output_width, jpeg_cinfo.output_height,
jpeg_cinfo.output_components);
}
} else {
DBG(0, "%s: cannot read JPEG header\n", __func__);
return SANE_STATUS_IO_ERROR;
}
}
void
eds_jpeg_finish(epsonds_scanner *s)
{
jpeg_destroy_decompress(&s->jpeg_cinfo);
}
void
eds_jpeg_read(SANE_Handle handle, SANE_Byte *data,
SANE_Int max_length, SANE_Int *length)
{
epsonds_scanner *s = handle;
struct jpeg_decompress_struct cinfo = s->jpeg_cinfo;
epsonds_src_mgr *src = (epsonds_src_mgr *)s->jpeg_cinfo.src;
int l;
*length = 0;
/* copy from line buffer if available */
if (src->linebuffer_size && src->linebuffer_index < src->linebuffer_size) {
*length = src->linebuffer_size - src->linebuffer_index;
if (*length > max_length)
*length = max_length;
memcpy(data, src->linebuffer + src->linebuffer_index, *length);
src->linebuffer_index += *length;
return;
}
if (cinfo.output_scanline >= cinfo.output_height) {
*length = 0;
return;
}
/* scanlines of decompressed data will be in s->jdst->buffer
* only one line at time is supported
*/
l = jpeg_read_scanlines(&cinfo, s->jdst->buffer, 1);
if (l == 0) {
return;
}
/* from s->jdst->buffer to linebuffer
* linebuffer holds width * bytesperpixel
*/
(*s->jdst->put_pixel_rows)(&cinfo, s->jdst, 1, (char *)src->linebuffer);
*length = cinfo.output_width * cinfo.output_components * 1;
src->linebuffer_size = *length;
src->linebuffer_index = 0;
if (*length > max_length)
*length = max_length;
memcpy(data, src->linebuffer + src->linebuffer_index, *length);
src->linebuffer_index += *length;
}
}
{
int sum = 0;
int bufSize = jpeg_cinfo.output_width * jpeg_cinfo.output_components;
int monoBufSize = (jpeg_cinfo.output_width + 7)/8;
JSAMPARRAY scanlines = (jpeg_cinfo.mem->alloc_sarray)((j_common_ptr)&jpeg_cinfo, JPOOL_IMAGE, bufSize, 1);
while (jpeg_cinfo.output_scanline < jpeg_cinfo.output_height) {
int l = jpeg_read_scanlines(&jpeg_cinfo, scanlines, 1);
if (l == 0) {
break;
}
sum += l;
if (needToConvertBW)
{
SANE_Byte* bytes = scanlines[0];
SANE_Int imgPos = 0;
for (int i = 0; i < monoBufSize; i++)
{
SANE_Byte outByte = 0;
for(SANE_Int bitIndex = 0; bitIndex < 8 && imgPos < bufSize; bitIndex++) {
//DBG(10,"bytes[imgPos] = %d\n", bytes[imgPos]);
if(bytes[imgPos] >= 110) {
SANE_Byte bit = 7 - (bitIndex % 8);
outByte |= (1<< bit);
}
imgPos += 1;
}
//DBG(10,"outByte = %d\n", outByte);
eds_ring_write(ringBuffer, &outByte, 1);
}
}
else
{
eds_ring_write(ringBuffer, scanlines[0], bufSize);
}
// decode until valida data
if (isBackSide)
{
if (sum >= s->height_back)
{
break;
}
}else
{
if (sum >= s->height_front)
{
break;
}
}
}
DBG(10,"decodded lines = %d\n", sum);
// abandon unncessary data
if ((JDIMENSION)sum < jpeg_cinfo.output_height)
{
// unncessary data
while(1)
{
int l = jpeg_read_scanlines(&jpeg_cinfo, scanlines, 1);
if (l == 0)
{
break;
}
}
}
// if not auto crop mode padding to lines
if (s->val[OPT_ADF_CRP].w == 0)
{
unsigned char* padding = malloc(s->params.bytes_per_line);
memset(padding, 255, s->params.bytes_per_line);
DBG(10,"padding data lines = %d to %d pa \n", sum, s->params.lines);
while(sum < s->params.lines)
{
eds_ring_write(ringBuffer, padding, bufSize);
sum++;
}
free(padding);
padding = NULL;
}
}
{
jpeg_finish_decompress(&jpeg_cinfo);
jpeg_destroy_decompress(&jpeg_cinfo);
}
return;
}

Wyświetl plik

@ -10,8 +10,4 @@
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, version 2.
*/
SANE_Status eds_jpeg_start(epsonds_scanner *s);
void eds_jpeg_finish(epsonds_scanner *s);
SANE_Status eds_jpeg_read_header(epsonds_scanner *s);
void eds_jpeg_read(SANE_Handle handle, SANE_Byte *data, SANE_Int max_length, SANE_Int *length);
void eds_decode_jpeg(epsonds_scanner*s, SANE_Byte *data, SANE_Int size, ring_buffer* ringBuffer, SANE_Int isBackSide, SANE_Int needToConvertBW);

Wyświetl plik

@ -32,10 +32,19 @@
#include "sane/sanei_debug.h"
static ssize_t
epsonds_net_read_raw(epsonds_scanner *s, unsigned char *buf, ssize_t wanted,
SANE_Status *status)
{
DBG(15, "%s: wanted: %ld\n", __func__, wanted);
if (wanted == 0)
{
*status = SANE_STATUS_GOOD;
return 0;
}
int ready;
ssize_t read = -1;
fd_set readable;
@ -70,7 +79,7 @@ epsonds_net_read_buf(epsonds_scanner *s, unsigned char *buf, ssize_t wanted,
ssize_t read = 0;
DBG(23, "%s: reading up to %lu from buffer at %p, %lu available\n",
__func__, (u_long) wanted, s->netptr, (u_long) s->netlen);
__func__, (u_long) wanted, (void *) s->netptr, (u_long) s->netlen);
if ((size_t) wanted > s->netlen) {
*status = SANE_STATUS_IO_ERROR;
@ -84,7 +93,7 @@ epsonds_net_read_buf(epsonds_scanner *s, unsigned char *buf, ssize_t wanted,
s->netlen -= read;
if (s->netlen == 0) {
DBG(23, "%s: freeing %p\n", __func__, s->netbuf);
DBG(23, "%s: freeing %p\n", __func__, (void *) s->netbuf);
free(s->netbuf);
s->netbuf = s->netptr = NULL;
s->netlen = 0;
@ -186,7 +195,7 @@ epsonds_net_write(epsonds_scanner *s, unsigned int cmd, const unsigned char *buf
if (reply_len) {
if (s->netbuf) {
DBG(23, "%s, freeing %p, %ld bytes unprocessed\n",
__func__, s->netbuf, (u_long) s->netlen);
__func__, (void *) s->netbuf, (u_long) s->netlen);
free(s->netbuf);
s->netbuf = s->netptr = NULL;
s->netlen = 0;
@ -199,11 +208,11 @@ epsonds_net_write(epsonds_scanner *s, unsigned int cmd, const unsigned char *buf
}
s->netlen = reply_len;
DBG(24, "%s: allocated %lu bytes at %p\n", __func__,
(u_long) s->netlen, s->netbuf);
(u_long) s->netlen, (void *) s->netbuf);
}
DBG(24, "%s: cmd = %04x, buf = %p, buf_size = %lu, reply_len = %lu\n",
__func__, cmd, buf, (u_long) buf_size, (u_long) reply_len);
__func__, cmd, (void *) buf, (u_long) buf_size, (u_long) reply_len);
memset(h1, 0x00, 12);
memset(h2, 0x00, 8);
@ -284,3 +293,228 @@ epsonds_net_unlock(struct epsonds_scanner *s)
/* epsonds_net_read(s, buf, 1, &status); */
return status;
}
#if WITH_AVAHI
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <avahi-client/lookup.h>
#include <avahi-common/error.h>
#include <avahi-common/simple-watch.h>
#include <sys/time.h>
#include <errno.h>
static AvahiSimplePoll *simple_poll = NULL;
static struct timeval borowseEndTime;
static int resolvedCount = 0;
static int browsedCount = 0;
static int waitResolver = 0;
typedef struct {
AvahiClient* client;
Device_Found_CallBack callBack;
}EDSAvahiUserData;
static int my_avahi_simple_poll_loop(AvahiSimplePoll *s) {
struct timeval currentTime;
for (;;)
{
int r = avahi_simple_poll_iterate(s, 1);
if (r != 0)
{
if (r >= 0 || errno != EINTR)
{
DBG(10, "my_avahi_simple_poll_loop end\n");
return r;
}
}
if (waitResolver) {
gettimeofday(&currentTime, NULL);
if ((currentTime.tv_sec - borowseEndTime.tv_sec) >= 3)
{
avahi_simple_poll_quit(simple_poll);
DBG(10, "resolve timeout\n");
return 0;
}
}
}
}
static void
epsonds_resolve_callback(AvahiServiceResolver *r, AVAHI_GCC_UNUSED AvahiIfIndex interface,
AVAHI_GCC_UNUSED AvahiProtocol protocol,
AvahiResolverEvent event, const char *name,
const char *type,
const char *domain,
const char *host_name,
const AvahiAddress *address, uint16_t port, AvahiStringList *txt,
AvahiLookupResultFlags flags,
void *userdata)
{
// unused parameter
(void)r;
(void)type;
(void)domain;
(void)host_name;
(void)port;
(void)flags;
EDSAvahiUserData* data = userdata;
char ipAddr[AVAHI_ADDRESS_STR_MAX];
DBG(10, "epsonds_searchDevices resolve_callback\n");
resolvedCount++;
switch (event) {
case AVAHI_RESOLVER_FAILURE:
break;
case AVAHI_RESOLVER_FOUND:
avahi_address_snprint(ipAddr, sizeof(ipAddr), address);
DBG(10, "epsonds_searchDevices name = %s \n", name);
if (strlen(name) > 7)
{
if (strncmp(name, "EPSON", 5) == 0)
{
while(txt != NULL)
{
char* text = (char*)avahi_string_list_get_text(txt);
DBG(10, "avahi string = %s\n", text);
if (strlen(text) > 4 && strncmp(text, "mdl=", 4) == 0)
{
if (data->callBack)
{
data->callBack(&text[4], ipAddr);
break;
}
}
txt = avahi_string_list_get_next(txt);
}
}
}
break;
}
}
static void
browse_callback(AvahiServiceBrowser *b, AvahiIfIndex interface,
AvahiProtocol protocol, AvahiBrowserEvent event,
const char *name, const char *type,
const char *domain,
AvahiLookupResultFlags flags,
void* userdata)
{
DBG(10, "browse_callback event = %d\n", event);
//unused parameter
(void)b;
(void)flags;
EDSAvahiUserData *data = userdata;
switch (event) {
case AVAHI_BROWSER_FAILURE:
avahi_simple_poll_quit(simple_poll);
return;
case AVAHI_BROWSER_NEW:
DBG(10, "browse_callback name = %s\n", name);
browsedCount++;
if (!(avahi_service_resolver_new(data->client, interface, protocol, name,
type, domain,
AVAHI_PROTO_UNSPEC, 0,
epsonds_resolve_callback, data)))
{
DBG(10, "avahi_service_resolver_new fails\n");
break;
}
case AVAHI_BROWSER_REMOVE:
break;
case AVAHI_BROWSER_ALL_FOR_NOW:
DBG(10, "AVAHI_BROWSER_ALL_FOR_NOW\n");
gettimeofday(&borowseEndTime, NULL);
if (browsedCount > resolvedCount)
{
DBG(10, "WAIT RESOLVER\n");
waitResolver = 1;
}else{
DBG(10, "QUIT POLL\n");
avahi_simple_poll_quit(simple_poll);
}
break;
case AVAHI_BROWSER_CACHE_EXHAUSTED:
DBG(10, "AVAHI_BROWSER_CACHE_EXHAUSTED\n");
break;
}
}
static void
client_callback(AvahiClient *c, AvahiClientState state,
AVAHI_GCC_UNUSED void *userdata)
{
assert(c);
if (state == AVAHI_CLIENT_FAILURE)
avahi_simple_poll_quit(simple_poll);
}
SANE_Status epsonds_searchDevices(Device_Found_CallBack deviceFoundCallBack)
{
int result = SANE_STATUS_GOOD;
AvahiClient *client = NULL;
AvahiServiceBrowser *sb = NULL;
EDSAvahiUserData data;
resolvedCount = 0;
browsedCount = 0;
waitResolver = 0;
int error = 0;
DBG(10, "epsonds_searchDevices\n");
if (!(simple_poll = avahi_simple_poll_new())) {
DBG(10, "avahi_simple_poll_new failed\n");
result = SANE_STATUS_INVAL;
goto fail;
}
client = avahi_client_new(avahi_simple_poll_get(simple_poll), 0,
client_callback, NULL, &error);
if (!client) {
DBG(10, "avahi_client_new failed %s\n", avahi_strerror(error));
result = SANE_STATUS_INVAL;
goto fail;
}
data.client = client;
data.callBack = deviceFoundCallBack;
if (!(sb = avahi_service_browser_new(client, AVAHI_IF_UNSPEC,
AVAHI_PROTO_UNSPEC, "_scanner._tcp",
NULL, 0, browse_callback, &data))) {
DBG(10, "avahi_service_browser_new failed: %s\n",
avahi_strerror(avahi_client_errno(client)));
result = SANE_STATUS_INVAL;
goto fail;
}
my_avahi_simple_poll_loop(simple_poll);
fail:
if (sb)
avahi_service_browser_free(sb);
if (client)
avahi_client_free(client);
if (simple_poll)
avahi_simple_poll_free(simple_poll);
DBG(10, "epsonds_searchDevices fin\n");
return result;
}
#endif

Wyświetl plik

@ -4,6 +4,8 @@
#include <sys/types.h>
#include "../include/sane/sane.h"
typedef void (*Device_Found_CallBack) (const char* name, const char* ip);
extern ssize_t epsonds_net_read(struct epsonds_scanner *s, unsigned char *buf, ssize_t buf_size,
SANE_Status *status);
extern size_t epsonds_net_write(struct epsonds_scanner *s, unsigned int cmd, const unsigned char *buf,
@ -13,4 +15,8 @@ extern SANE_Status epsonds_net_lock(struct epsonds_scanner *s);
extern SANE_Status epsonds_net_unlock(struct epsonds_scanner *s);
extern SANE_Status epsonds_net_request_read(epsonds_scanner *s, size_t len);
#if WITH_AVAHI
extern SANE_Status epsonds_searchDevices(Device_Found_CallBack deviceFoundCallBack);
#endif
#endif

Wyświetl plik

@ -28,10 +28,9 @@
extern struct mode_param mode_params[];
/* Define the different scan sources */
#define FBF_STR SANE_I18N("Flatbed")
#define TPU_STR SANE_I18N("Transparency Unit")
#define ADF_STR SANE_I18N("Automatic Document Feeder")
#define STRING_FLATBED SANE_I18N("Flatbed")
#define STRING_ADFFRONT SANE_I18N("ADF Front")
#define STRING_ADFDUPLEX SANE_I18N("ADF Duplex")
extern SANE_String_Const source_list[];
@ -53,10 +52,13 @@ eds_dev_post_init(struct epsonds_device *dev)
DBG(10, "%s\n", __func__);
if (dev->has_fb)
*source_list_add++ = FBF_STR;
*source_list_add++ = STRING_FLATBED;
if (dev->has_adf)
*source_list_add++ = ADF_STR;
*source_list_add++ = STRING_ADFFRONT;
if (dev->adf_is_duplex)
*source_list_add++ = STRING_ADFDUPLEX;
if (source_list[0] == 0
|| (dev->res_list[0] == 0 && dev->dpi_range.min == 0)
@ -209,8 +211,6 @@ eds_init_parameters(epsonds_scanner *s)
memset(&s->params, 0, sizeof(SANE_Parameters));
s->dummy = 0;
/* setup depth according to our mode table */
if (mode_params[s->val[OPT_MODE].w].depth == 1)
s->params.depth = 1;
@ -314,6 +314,7 @@ eds_init_parameters(epsonds_scanner *s)
return SANE_STATUS_GOOD;
}
#define min(A,B) (((A)<(B)) ? (A) : (B))
void
eds_copy_image_from_ring(epsonds_scanner *s, SANE_Byte *data, SANE_Int max_length,
@ -322,17 +323,13 @@ eds_copy_image_from_ring(epsonds_scanner *s, SANE_Byte *data, SANE_Int max_lengt
int lines, available;
int hw_line_size = (s->params.bytes_per_line + s->dummy);
/* trim max_length to a multiple of hw_line_size */
max_length -= (max_length % hw_line_size);
/* check available data */
available = eds_ring_avail(s->current);
if (max_length > available)
max_length = available;
lines = max_length / hw_line_size;
lines = min(max_length / s->params.bytes_per_line, available / hw_line_size);
DBG(18, "copying %d lines (%d, %d)\n", lines, s->params.bytes_per_line, s->dummy);
DBG(18, "copying %d lines (%d, %d, %d)\n", lines, s->params.bytes_per_line, s->dummy, s->params.depth);
/* need more data? */
if (lines == 0) {
@ -490,3 +487,12 @@ void eds_ring_flush(ring_buffer *ring)
{
eds_ring_skip(ring, ring->fill);
}
void eds_ring_destory(ring_buffer *ring)
{
if (ring->ring)
{
free(ring->ring);
ring->ring = NULL;
}
}

Wyświetl plik

@ -38,3 +38,4 @@ extern SANE_Int eds_ring_read(ring_buffer *ring, SANE_Byte *buf, SANE_Int size);
extern SANE_Int eds_ring_skip(ring_buffer *ring, SANE_Int size);
extern SANE_Int eds_ring_avail(ring_buffer *ring);
extern void eds_ring_flush(ring_buffer *ring) ;
extern void eds_ring_destory(ring_buffer *ring) ;

Wyświetl plik

@ -12,22 +12,3 @@
*/
#include "epsonds-usb.h"
SANE_Word epsonds_usb_product_ids[] = {
0x0145, /* DS-5500, DS-6500, DS-7500 */
0x0146, /* DS-50000, DS-60000, DS-70000 */
0x014c, /* DS-510 */
0x014d, /* DS-560 */
0x0150, /* DS-40 */
0x0152, /* DS-760, DS-860 */
0x0154, /* DS-520 */
0x08bc, /* PX-M7050 Series, WF-8510/8590 Series */
0x08cc, /* PX-M7050FX Series, WF-R8590 Series */
0 /* last entry - this is used for devices that are specified
in the config file as "usb <vendor> <product>" */
};
int epsonds_get_number_of_ids(void)
{
return sizeof (epsonds_usb_product_ids) / sizeof (SANE_Word);
}

Wyświetl plik

@ -18,7 +18,4 @@
#define SANE_EPSONDS_VENDOR_ID (0x4b8)
extern SANE_Word epsonds_usb_product_ids[];
extern int epsonds_get_number_of_ids(void);
#endif

Plik diff jest za duży Load Diff

Wyświetl plik

@ -10,7 +10,8 @@ usb
# e.g.:
# usb 0x4b8 0x14c
# Network (not yet supported!)
#
# Network
#
# net 192.168.1.123
#net autodiscovery
net autodiscovery

Wyświetl plik

@ -66,9 +66,14 @@
#define TPU_STR SANE_I18N("Transparency Unit")
#define ADF_STR SANE_I18N("Automatic Document Feeder")
#define STRING_FLATBED SANE_I18N("Flatbed")
#define STRING_ADFFRONT SANE_I18N("ADF Front")
#define STRING_ADFDUPLEX SANE_I18N("ADF Duplex")
enum {
OPT_NUM_OPTS = 0,
OPT_MODE_GROUP,
OPT_STANDARD_GROUP,
OPT_SOURCE,
OPT_MODE,
OPT_DEPTH,
OPT_RESOLUTION,
@ -78,11 +83,10 @@ enum {
OPT_BR_X,
OPT_BR_Y,
OPT_EQU_GROUP,
OPT_SOURCE,
OPT_EJECT,
OPT_LOAD,
OPT_ADF_MODE,
OPT_ADF_SKEW,
OPT_ADF_CRP,
NUM_OPTIONS
};
@ -119,6 +123,8 @@ struct epsonds_device
SANE_Bool has_raw; /* supports RAW format */
SANE_Bool has_mono; /*supprt M001*/
SANE_Bool has_fb; /* flatbed */
SANE_Range fbf_x_range; /* x range */
SANE_Range fbf_y_range; /* y range */
@ -136,9 +142,13 @@ struct epsonds_device
SANE_Byte adf_alignment; /* left, center, right */
SANE_Byte adf_has_dfd; /* supports double feed detection */
SANE_Byte adf_has_crp; /* supports crp */
SANE_Bool has_tpu; /* tpu */
SANE_Range tpu_x_range; /* transparency unit x range */
SANE_Range tpu_y_range; /* transparency unit y range */
SANE_Int lut_id;
};
typedef struct epsonds_device epsonds_device;
@ -171,6 +181,10 @@ struct epsonds_scanner
SANE_Int left, top, pages, dummy;
SANE_Int width_front, height_front;
SANE_Int width_back , height_back;
SANE_Int width_temp, height_temp;
/* jpeg stuff */
djpeg_dest_ptr jdst;
@ -181,7 +195,18 @@ struct epsonds_scanner
/* network buffers */
unsigned char *netbuf, *netptr;
size_t netlen;
};
SANE_Byte *frontJpegBuf, *backJpegBuf;
SANE_Int frontJpegBufLen, backJpegBufLen;
SANE_Int acquirePage;
SANE_Int isflatbedScan;
SANE_Int isDuplexScan;
SANE_Int needToConvertBW;
SANE_Int scanEnd;
};
typedef struct epsonds_scanner epsonds_scanner;

Wyświetl plik

@ -11,6 +11,11 @@
# You can also configure a device on a single line starting with 'device'
# by writing a complete URL and an optional model name.
# Name of the device not using the PDF format. Spaces are replaced by _. Please report the devices having this problem on sane-devel
# Uncomment the line to add your device
#pdfblacklist Brother_DCP-L2530DW_series
#device http://123.456.789.10:8080 OptionalModel1
#device https://123.456.789.10:443 "Optional Model 2"
#device https://123.456.789.10:443 "HP Color LaserJet FlowMFP M578" "hack=localhost"

Wyświetl plik

@ -61,6 +61,26 @@ static const SANE_Device **devlist = NULL;
static ESCL_Device *list_devices_primary = NULL;
static int num_devices = 0;
#ifdef CURL_SSLVERSION_MAX_DEFAULT
static int proto_tls[] = {
CURL_SSLVERSION_MAX_DEFAULT,
#ifdef CURL_SSLVERSION_MAX_TLSv1_3
CURL_SSLVERSION_MAX_TLSv1_3,
#endif
#ifdef CURL_SSLVERSION_MAX_TLSv1_2
CURL_SSLVERSION_MAX_TLSv1_2,
#endif
#ifdef CURL_SSLVERSION_MAX_TLSv1_1
CURL_SSLVERSION_MAX_TLSv1_1,
#endif
#ifdef CURL_SSLVERSION_MAX_TLSv1_0
CURL_SSLVERSION_MAX_TLSv1_0,
#endif
-1
};
#endif
typedef struct Handled {
struct Handled *next;
ESCL_Device *device;
@ -99,6 +119,60 @@ escl_free_device(ESCL_Device *current)
return NULL;
}
#ifdef CURL_SSLVERSION_MAX_DEFAULT
static int
escl_tls_protocol_supported(char *url, int proto)
{
CURLcode res = CURLE_UNSUPPORTED_PROTOCOL;
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, url);
/* ask libcurl to use TLS version 1.0 or later */
curl_easy_setopt(curl, CURLOPT_SSLVERSION, proto);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 3L);
/* Perform the request */
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
return res;
}
static int
escl_is_tls(char * url, char *type)
{
int tls_version = 0;
if(!strcmp(type, "_uscans._tcp") ||
!strcmp(type, "https"))
{
while(proto_tls[tls_version] != -1)
{
if (escl_tls_protocol_supported(url, proto_tls[tls_version]) == CURLE_OK)
{
DBG(10, "curl tls compatible (%d)\n", proto_tls[tls_version]);
break;
}
tls_version++;
}
if (proto_tls[tls_version] < 1)
return 0;
}
return proto_tls[tls_version];
}
#else
static int
escl_is_tls(char * url, char *type)
{
(void)url;
(void)type;
return 0;
}
#endif
void
escl_free_handler(escl_sane_t *handler)
{
@ -187,8 +261,13 @@ escl_device_add(int port_nb,
{
char tmp[PATH_MAX] = { 0 };
char *model = NULL;
char url_port[512] = { 0 };
int tls_version = 0;
ESCL_Device *current = NULL;
DBG (10, "escl_device_add\n");
snprintf(url_port, sizeof(url_port), "https://%s:%d", ip_address, port_nb);
tls_version = escl_is_tls(url_port, type);
for (current = list_devices_primary; current; current = current->next) {
if ((strcmp(current->ip_address, ip_address) == 0) ||
(uuid && current->uuid && !strcmp(current->uuid, uuid)))
@ -206,6 +285,7 @@ escl_device_add(int port_nb,
}
current->port_nb = port_nb;
current->https = SANE_TRUE;
current->tls = tls_version;
}
return (SANE_STATUS_GOOD);
}
@ -226,6 +306,7 @@ escl_device_add(int port_nb,
} else {
current->https = SANE_FALSE;
}
current->tls = tls_version;
model = (char*)(tmp[0] != 0 ? tmp : model_name);
current->model_name = strdup(model);
current->ip_address = strdup(ip_address);
@ -432,7 +513,8 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line,
int port = 0;
SANE_Status status;
static ESCL_Device *escl_device = NULL;
if (*line == '#') return SANE_STATUS_GOOD;
if (!strncmp(line, "pdfblacklist", 12)) return SANE_STATUS_GOOD;
if (strncmp(line, "device", 6) == 0) {
char *name_str = NULL;
char *opt_model = NULL;
@ -469,7 +551,6 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line,
}
escl_device->model_name = opt_model ? opt_model : strdup("Unknown model");
escl_device->is = strdup("flatbed or ADF scanner");
escl_device->type = strdup("In url");
escl_device->uuid = NULL;
}
@ -514,6 +595,9 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line,
}
escl_device->is = strdup("flatbed or ADF scanner");
escl_device->uuid = NULL;
char url_port[512] = { 0 };
snprintf(url_port, sizeof(url_port), "https://%s:%d", escl_device->ip_address, escl_device->port_nb);
escl_device->tls = escl_is_tls(url_port, escl_device->type);
status = escl_check_and_add_device(escl_device);
if (status == SANE_STATUS_GOOD)
escl_device = NULL;
@ -537,16 +621,20 @@ sane_get_devices(const SANE_Device ***device_list, SANE_Bool local_only)
ESCL_Device *dev = NULL;
static const SANE_Device **devlist = 0;
SANE_Status status;
SANE_Status status2;
if (device_list == NULL)
return (SANE_STATUS_INVAL);
status = sanei_configure_attach(ESCL_CONFIG_FILE, NULL,
status2 = sanei_configure_attach(ESCL_CONFIG_FILE, NULL,
attach_one_config, NULL);
if (status != SANE_STATUS_GOOD)
return (status);
escl_devices(&status);
if (status != SANE_STATUS_GOOD)
return (status);
if (status != SANE_STATUS_GOOD && status2 != SANE_STATUS_GOOD)
{
if (status2 != SANE_STATUS_GOOD)
return (status2);
if (status != SANE_STATUS_GOOD)
return (status);
}
if (devlist)
free(devlist);
devlist = (const SANE_Device **) calloc (num_devices + 1, sizeof (devlist[0]));
@ -955,7 +1043,7 @@ init_options(SANE_String_Const name_source, escl_sane_t *s)
s->opt[OPT_BRIGHTNESS].constraint_type = SANE_CONSTRAINT_RANGE;
if (s->scanner->brightness) {
s->opt[OPT_BRIGHTNESS].constraint.range = &s->brightness_range;
s->val[OPT_BRIGHTNESS].w = s->scanner->brightness->normal;
s->val[OPT_BRIGHTNESS].w = s->scanner->brightness->value;
s->brightness_range.quant=1;
s->brightness_range.min=s->scanner->brightness->min;
s->brightness_range.max=s->scanner->brightness->max;
@ -974,7 +1062,7 @@ init_options(SANE_String_Const name_source, escl_sane_t *s)
s->opt[OPT_CONTRAST].constraint_type = SANE_CONSTRAINT_RANGE;
if (s->scanner->contrast) {
s->opt[OPT_CONTRAST].constraint.range = &s->contrast_range;
s->val[OPT_CONTRAST].w = s->scanner->contrast->normal;
s->val[OPT_CONTRAST].w = s->scanner->contrast->value;
s->contrast_range.quant=1;
s->contrast_range.min=s->scanner->contrast->min;
s->contrast_range.max=s->scanner->contrast->max;
@ -993,7 +1081,7 @@ init_options(SANE_String_Const name_source, escl_sane_t *s)
s->opt[OPT_SHARPEN].constraint_type = SANE_CONSTRAINT_RANGE;
if (s->scanner->sharpen) {
s->opt[OPT_SHARPEN].constraint.range = &s->sharpen_range;
s->val[OPT_SHARPEN].w = s->scanner->sharpen->normal;
s->val[OPT_SHARPEN].w = s->scanner->sharpen->value;
s->sharpen_range.quant=1;
s->sharpen_range.min=s->scanner->sharpen->min;
s->sharpen_range.max=s->scanner->sharpen->max;
@ -1013,7 +1101,7 @@ init_options(SANE_String_Const name_source, escl_sane_t *s)
s->opt[OPT_THRESHOLD].constraint_type = SANE_CONSTRAINT_RANGE;
if (s->scanner->threshold) {
s->opt[OPT_THRESHOLD].constraint.range = &s->thresold_range;
s->val[OPT_THRESHOLD].w = s->scanner->threshold->normal;
s->val[OPT_THRESHOLD].w = s->scanner->threshold->value;
s->thresold_range.quant=1;
s->thresold_range.min= s->scanner->threshold->min;
s->thresold_range.max=s->scanner->threshold->max;
@ -1068,9 +1156,11 @@ escl_parse_name(SANE_String_Const name, ESCL_Device *device)
if (strncmp(name, "https://", 8) == 0) {
device->https = SANE_TRUE;
device->type = strdup("https");
host = name + 8;
} else if (strncmp(name, "http://", 7) == 0) {
device->https = SANE_FALSE;
device->type = strdup("http");
host = name + 7;
} else {
DBG(1, "Unknown URL scheme in %s", name);
@ -1135,6 +1225,37 @@ finish_hack:
fclose(fp);
}
static char*
_get_blacklist_pdf(void)
{
FILE *fp;
char *blacklist = NULL;
SANE_Char line[PATH_MAX];
/* open configuration file */
fp = sanei_config_open (ESCL_CONFIG_FILE);
if (!fp)
{
DBG (2, "_get_blacklit: couldn't access %s\n", ESCL_CONFIG_FILE);
DBG (3, "_get_blacklist: exit\n");
}
/* loop reading the configuration file, all line beginning by "option " are
* parsed for value to store in configuration structure, other line are
* used are device to try to attach
*/
while (sanei_config_read (line, PATH_MAX, fp))
{
if (!strncmp(line, "pdfblacklist", 12)) {
blacklist = strdup(line);
goto finish_;
}
}
finish_:
DBG (3, "_get_blacklist_pdf: finish\n");
fclose(fp);
return blacklist;
}
/**
@ -1149,6 +1270,7 @@ finish_hack:
SANE_Status
sane_open(SANE_String_Const name, SANE_Handle *h)
{
char *blacklist = NULL;
DBG (10, "escl sane_open\n");
SANE_Status status;
escl_sane_t *handler = NULL;
@ -1173,7 +1295,8 @@ sane_open(SANE_String_Const name, SANE_Handle *h)
return (SANE_STATUS_NO_MEM);
}
handler->device = device; // Handler owns device now.
handler->scanner = escl_capabilities(device, &status);
blacklist = _get_blacklist_pdf();
handler->scanner = escl_capabilities(device, blacklist, &status);
if (status != SANE_STATUS_GOOD) {
escl_free_handler(handler);
return (status);
@ -1222,9 +1345,11 @@ sane_cancel(SANE_Handle h)
}
handler->scanner->work = SANE_FALSE;
handler->cancel = SANE_TRUE;
escl_scanner(handler->device, handler->result);
escl_scanner(handler->device, handler->scanner->scanJob, handler->result, SANE_TRUE);
free(handler->result);
handler->result = NULL;
free(handler->scanner->scanJob);
handler->scanner->scanJob = NULL;
}
/**
@ -1381,6 +1506,7 @@ sane_control_option(SANE_Handle h, SANE_Int n, SANE_Action a, void *v, SANE_Int
break;
case OPT_RESOLUTION:
handler->val[n].w = _get_resolution(handler, (int)(*(SANE_Word *) v));
handler->scanner->caps[handler->scanner->source].default_resolution = handler->val[n].w;
if (i)
*i |= SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS | SANE_INFO_INEXACT;
break;
@ -1440,6 +1566,7 @@ sane_start(SANE_Handle h)
handler->decompress_scan_data = SANE_FALSE;
handler->end_read = SANE_FALSE;
if (handler->scanner->work == SANE_FALSE) {
escl_reset_all_jobs(handler->device);
SANE_Status st = escl_status(handler->device,
handler->scanner->source,
NULL,
@ -1591,7 +1718,7 @@ sane_start(SANE_Handle h)
return SANE_STATUS_NO_DOCS;
}
}
status = escl_scan(handler->scanner, handler->device, handler->result);
status = escl_scan(handler->scanner, handler->device, handler->scanner->scanJob, handler->result);
if (status != SANE_STATUS_GOOD)
return (status);
if (!strcmp(handler->scanner->caps[handler->scanner->source].default_format, "image/jpeg"))
@ -1774,6 +1901,8 @@ escl_curl_url(CURL *handle, const ESCL_Device *device, SANE_String_Const path)
DBG( 1, "Ignoring safety certificates, use https\n");
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 0L);
if (device->tls > 0)
curl_easy_setopt(handle, CURLOPT_SSLVERSION, device->tls);
}
if (device->unix_socket != NULL) {
DBG( 1, "Using local socket %s\n", device->unix_socket );

Wyświetl plik

@ -92,10 +92,12 @@ typedef struct {
typedef struct ESCL_Device {
struct ESCL_Device *next;
char *version;
char *model_name;
int port_nb;
char *ip_address;
char *is;
int tls;
char *uuid;
char *type;
SANE_Bool https;
@ -146,6 +148,7 @@ typedef struct support
int min;
int max;
int normal;
int value;
int step;
} support_t;
@ -156,6 +159,7 @@ typedef struct capabilities
SANE_String_Const *Sources;
int SourcesSize;
FILE *tmp;
char *scanJob;
unsigned char *img_data;
long img_size;
long img_read;
@ -230,6 +234,7 @@ SANE_Status escl_status(const ESCL_Device *device,
SANE_Status *job);
capabilities_t *escl_capabilities(ESCL_Device *device,
char *blacklist,
SANE_Status *status);
char *escl_newjob(capabilities_t *scanner,
@ -238,10 +243,16 @@ char *escl_newjob(capabilities_t *scanner,
SANE_Status escl_scan(capabilities_t *scanner,
const ESCL_Device *device,
char *scanJob,
char *result);
void escl_scanner(const ESCL_Device *device,
char *result);
char *scanJob,
char *result,
SANE_Bool status);
SANE_Status escl_reset_all_jobs(ESCL_Device *device);
typedef void CURL;

Wyświetl plik

@ -40,6 +40,25 @@ struct cap
size_t size;
};
static size_t
header_callback(void *str, size_t size, size_t nmemb, void *userp)
{
struct cap *header = (struct cap *)userp;
size_t realsize = size * nmemb;
char *content = realloc(header->memory, header->size + realsize + 1);
if (content == NULL) {
DBG( 1, "Not enough memory (realloc returned NULL)\n");
return (0);
}
header->memory = content;
memcpy(&(header->memory[header->size]), str, realsize);
header->size = header->size + realsize;
header->memory[header->size] = 0;
return (realsize);
}
/**
* \fn static SANE_String_Const convert_elements(SANE_String_Const str)
* \brief Function that converts the 'color modes' of the scanner (color/gray) to be understood by SANE.
@ -53,7 +72,7 @@ convert_elements(SANE_String_Const str)
return (SANE_VALUE_SCAN_MODE_GRAY);
else if (strcmp(str, "RGB24") == 0)
return (SANE_VALUE_SCAN_MODE_COLOR);
#if(defined HAVE_POPPLER_GLIB)
#if HAVE_POPPLER_GLIB
else if (strcmp(str, "BlackAndWhite1") == 0)
return (SANE_VALUE_SCAN_MODE_LINEART);
#endif
@ -182,10 +201,12 @@ find_valor_of_array_variables(xmlNode *node, capabilities_t *scanner, int type)
{
const char *name = (const char *)node->name;
if (strcmp(name, "ColorMode") == 0) {
const char *color = (SANE_String_Const)xmlNodeGetContent(node);
if (type == PLATEN || strcmp(color, "BlackAndWhite1"))
#ifndef HAVE_POPPLER_GLIB
const char *color = (SANE_String_Const)xmlNodeGetContent(node);
if (strcmp(color, "BlackAndWhite1"))
#endif
scanner->caps[type].ColorModes = char_to_array(scanner->caps[type].ColorModes, &scanner->caps[type].ColorModesSize, (SANE_String_Const)xmlNodeGetContent(node), 1);
}
}
else if (strcmp(name, "ContentType") == 0)
scanner->caps[type].ContentTypes = char_to_array(scanner->caps[type].ContentTypes, &scanner->caps[type].ContentTypesSize, (SANE_String_Const)xmlNodeGetContent(node), 0);
else if (strcmp(name, "DocumentFormat") == 0)
@ -212,14 +233,14 @@ find_valor_of_array_variables(xmlNode *node, capabilities_t *scanner, int type)
}
#endif
#if(defined HAVE_TIFFIO_H)
else if(type == PLATEN && !strcmp(scanner->caps[type].DocumentFormats[i], "image/tiff"))
else if(!strcmp(scanner->caps[type].DocumentFormats[i], "image/tiff"))
{
have_tiff = SANE_TRUE;
scanner->caps[type].have_tiff = i;
}
#endif
#if(defined HAVE_POPPLER_GLIB)
else if(type == PLATEN && !strcmp(scanner->caps[type].DocumentFormats[i], "application/pdf"))
#if HAVE_POPPLER_GLIB
else if(!strcmp(scanner->caps[type].DocumentFormats[i], "application/pdf"))
{
have_pdf = SANE_TRUE;
scanner->caps[type].have_pdf = i;
@ -306,7 +327,8 @@ print_support(xmlNode *node)
cpt++;
}
else if (!strcmp((const char *)node->name, "Normal")) {
sup->normal = atoi((const char *)xmlNodeGetContent(node));
sup->value = atoi((const char *)xmlNodeGetContent(node));
sup->normal = sup->value;
cpt++;
have_norm = 1;
}
@ -319,7 +341,8 @@ print_support(xmlNode *node)
if (cpt == 4)
return sup;
if (cpt == 3 && have_norm == 0) {
sup->normal = (sup->max / 2 );
sup->value = (sup->max / 2 );
sup->normal = sup->value;
return sup;
}
free(sup);
@ -385,6 +408,16 @@ find_true_variables(xmlNode *node, capabilities_t *scanner, int type)
return (0);
}
static char*
replace_char(char* str, char find, char replace){
char *current_pos = strchr(str,find);
while (current_pos) {
*current_pos = replace;
current_pos = strchr(current_pos,find);
}
return str;
}
/**
* \fn static int print_xml_c(xmlNode *node, capabilities_t *scanner)
* \brief Function that browses the xml file, node by node.
@ -399,6 +432,10 @@ print_xml_c(xmlNode *node, ESCL_Device *device, capabilities_t *scanner, int typ
if (find_nodes_c(node) && type != -1)
find_true_variables(node, scanner, type);
}
if (!strcmp((const char *)node->name, "Version")&& node->ns && node->ns->prefix){
if (!strcmp((const char*)node->ns->prefix, "pwg"))
device->version = strdup((const char *)xmlNodeGetContent(node));
}
if (!strcmp((const char *)node->name, "MakeAndModel")){
device->model_name = strdup((const char *)xmlNodeGetContent(node));
}
@ -454,6 +491,37 @@ _reduce_color_modes(capabilities_t *scanner)
}
}
static void
_delete_pdf(capabilities_t *scanner)
{
int type = 0;
for (type = 0; type < 3; type++) {
if (scanner->caps[type].ColorModesSize) {
if (scanner->caps[type].default_format) {
scanner->caps[type].have_pdf = -1;
if (!strcmp(scanner->caps[type].default_format, "application/pdf")) {
free(scanner->caps[type].default_format);
if (scanner->caps[type].have_tiff > -1)
scanner->caps[type].default_format = strdup("image/tiff");
else if (scanner->caps[type].have_png > -1)
scanner->caps[type].default_format = strdup("image/png");
else if (scanner->caps[type].have_jpeg > -1)
scanner->caps[type].default_format = strdup("image/jpeg");
}
free(scanner->caps[type].ColorModes);
scanner->caps[type].ColorModes = NULL;
scanner->caps[type].ColorModesSize = 0;
scanner->caps[type].ColorModes = char_to_array(scanner->caps[type].ColorModes,
&scanner->caps[type].ColorModesSize,
(SANE_String_Const)SANE_VALUE_SCAN_MODE_GRAY, 0);
scanner->caps[type].ColorModes = char_to_array(scanner->caps[type].ColorModes,
&scanner->caps[type].ColorModesSize,
(SANE_String_Const)SANE_VALUE_SCAN_MODE_COLOR, 0);
}
}
}
}
/**
* \fn capabilities_t *escl_capabilities(const ESCL_Device *device, SANE_Status *status)
* \brief Function that finally recovers all the capabilities of the scanner, using curl.
@ -463,15 +531,17 @@ _reduce_color_modes(capabilities_t *scanner)
* \return scanner (the structure that stocks all the capabilities elements)
*/
capabilities_t *
escl_capabilities(ESCL_Device *device, SANE_Status *status)
escl_capabilities(ESCL_Device *device, char *blacklist, SANE_Status *status)
{
capabilities_t *scanner = (capabilities_t*)calloc(1, sizeof(capabilities_t));
CURL *curl_handle = NULL;
struct cap *var = NULL;
struct cap *header = NULL;
xmlDoc *data = NULL;
xmlNode *node = NULL;
int i = 0;
const char *scanner_capabilities = "/eSCL/ScannerCapabilities";
SANE_Bool use_pdf = SANE_TRUE;
*status = SANE_STATUS_GOOD;
if (device == NULL)
@ -481,11 +551,22 @@ escl_capabilities(ESCL_Device *device, SANE_Status *status)
*status = SANE_STATUS_NO_MEM;
var->memory = malloc(1);
var->size = 0;
header = (struct cap *)calloc(1, sizeof(struct cap));
if (header == NULL)
*status = SANE_STATUS_NO_MEM;
header->memory = malloc(1);
header->size = 0;
curl_handle = curl_easy_init();
escl_curl_url(curl_handle, device, scanner_capabilities);
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, memory_callback_c);
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)var);
curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, header_callback);
curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, (void *)header);
curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 3L);
CURLcode res = curl_easy_perform(curl_handle);
if (res == CURLE_OK)
DBG( 1, "Create NewJob : the scanner header responded : [%s]\n", header->memory);
if (res != CURLE_OK) {
DBG( 1, "The scanner didn't respond: %s\n", curl_easy_strerror(res));
*status = SANE_STATUS_INVAL;
@ -503,18 +584,46 @@ escl_capabilities(ESCL_Device *device, SANE_Status *status)
goto clean;
}
if (device->hack &&
header &&
header->memory &&
strstr(header->memory, "Server: HP_Compact_Server"))
device->hack = curl_slist_append(NULL, "Host: localhost");
scanner->source = 0;
scanner->Sources = (SANE_String_Const *)malloc(sizeof(SANE_String_Const) * 4);
for (i = 0; i < 4; i++)
scanner->Sources[i] = NULL;
print_xml_c(node, device, scanner, -1);
_reduce_color_modes(scanner);
DBG (3, "1-blacklist_pdf: %s\n", (use_pdf ? "TRUE" : "FALSE") );
if (device->model_name != NULL) {
if (strcasestr(device->model_name, "MFC-J985DW")) {
DBG (3, "blacklist_pdf: device not support PDF\n");
use_pdf = SANE_FALSE;
}
else if (blacklist) {
char *model = strdup(device->model_name);
replace_char(model, ' ', '_');
if (strcasestr(blacklist, model)) {
use_pdf = SANE_FALSE;
}
free(model);
}
}
DBG (3, "1-blacklist_pdf: %s\n", (use_pdf ? "TRUE" : "FALSE") );
if (use_pdf)
_reduce_color_modes(scanner);
else
_delete_pdf(scanner);
clean:
xmlFreeDoc(data);
clean_data:
xmlCleanupParser();
xmlMemoryDump();
curl_easy_cleanup(curl_handle);
if (header)
free(header->memory);
free(header);
if (var)
free(var->memory);
free(var);

Wyświetl plik

@ -30,6 +30,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <arpa/inet.h>
#include <avahi-client/lookup.h>
#include <avahi-common/error.h>
@ -53,39 +54,65 @@ static int count_finish = 0;
*/
static void
resolve_callback(AvahiServiceResolver *r, AVAHI_GCC_UNUSED AvahiIfIndex interface,
AVAHI_GCC_UNUSED AvahiProtocol protocol,
AvahiResolverEvent event, const char *name,
AvahiProtocol protocol,
AvahiResolverEvent event,
const char *name,
const char __sane_unused__ *type,
const char __sane_unused__ *domain,
const char __sane_unused__ *host_name,
const AvahiAddress *address, uint16_t port, AvahiStringList *txt,
const AvahiAddress *address,
uint16_t port,
AvahiStringList *txt,
AvahiLookupResultFlags __sane_unused__ flags,
void __sane_unused__ *userdata)
{
char a[AVAHI_ADDRESS_STR_MAX], *t;
char a[(AVAHI_ADDRESS_STR_MAX + 10)] = { 0 };
char *t;
const char *is;
const char *uuid;
AvahiStringList *s;
assert(r);
switch (event) {
case AVAHI_RESOLVER_FAILURE:
break;
case AVAHI_RESOLVER_FOUND:
avahi_address_snprint(a, sizeof(a), address);
t = avahi_string_list_to_string(txt);
if (strstr(t, "\"rs=eSCL\"") || strstr(t, "\"rs=/eSCL\"")) {
s = avahi_string_list_find(txt, "is");
if (s && s->size > 3)
is = (const char*)s->text + 3;
else
is = (const char*)NULL;
s = avahi_string_list_find(txt, "uuid");
if (s && s->size > 5)
uuid = (const char*)s->text + 5;
else
uuid = (const char*)NULL;
escl_device_add(port, name, a, is, uuid, (char*)type);
}
case AVAHI_RESOLVER_FAILURE:
break;
case AVAHI_RESOLVER_FOUND:
{
char *psz_addr = ((void*)0);
char b[128] = { 0 };
avahi_address_snprint(b, (sizeof(b)/sizeof(b[0]))-1, address);
#ifdef ENABLE_IPV6
if (protocol == AVAHI_PROTO_INET6 && strchr(b, ':'))
{
if ( asprintf( &psz_addr, "[%s]", b ) == -1 )
break;
}
else
#endif
{
if ( asprintf( &psz_addr, "%s", b ) == -1 )
break;
}
t = avahi_string_list_to_string(txt);
if (strstr(t, "\"rs=eSCL\"") || strstr(t, "\"rs=/eSCL\"")) {
s = avahi_string_list_find(txt, "is");
if (s && s->size > 3)
is = (const char*)s->text + 3;
else
is = (const char*)NULL;
s = avahi_string_list_find(txt, "uuid");
if (s && s->size > 5)
uuid = (const char*)s->text + 5;
else
uuid = (const char*)NULL;
DBG (10, "resolve_callback [%s]\n", a);
if (strstr(psz_addr, "127.0.0.1") != NULL) {
escl_device_add(port, name, "localhost", is, uuid, (char*)type);
DBG (10,"resolve_callback fix redirect [localhost]\n");
}
else
escl_device_add(port, name, psz_addr, is, uuid, (char*)type);
}
}
}
}

Wyświetl plik

@ -192,40 +192,53 @@ get_JPEG_data(capabilities_t *scanner, int *width, int *height, int *bps)
cinfo.out_color_space = JCS_RGB;
cinfo.quantize_colors = FALSE;
jpeg_calc_output_dimensions(&cinfo);
if (cinfo.output_width < (unsigned int)scanner->caps[scanner->source].width)
scanner->caps[scanner->source].width = cinfo.output_width;
if (scanner->caps[scanner->source].pos_x < 0)
scanner->caps[scanner->source].pos_x = 0;
double ratio = (double)cinfo.output_width / (double)scanner->caps[scanner->source].width;
int rw = (int)((double)scanner->caps[scanner->source].width * ratio);
int rh = (int)((double)scanner->caps[scanner->source].height * ratio);
int rx = (int)((double)scanner->caps[scanner->source].pos_x * ratio);
int ry = (int)((double)scanner->caps[scanner->source].pos_y * ratio);
if (cinfo.output_height < (unsigned int)scanner->caps[scanner->source].height)
scanner->caps[scanner->source].height = cinfo.output_height;
if (scanner->caps[scanner->source].pos_y < 0)
scanner->caps[scanner->source].pos_y = 0;
if (cinfo.output_width < (unsigned int)rw)
rw = cinfo.output_width;
if (rx < 0)
rx = 0;
if (cinfo.output_height < (unsigned int)rh)
rh = cinfo.output_height;
if (ry < 0)
ry = 0;
DBG(10, "1-JPEF Geometry [%dx%d|%dx%d]\n",
scanner->caps[scanner->source].pos_x,
scanner->caps[scanner->source].pos_y,
scanner->caps[scanner->source].width,
scanner->caps[scanner->source].height);
x_off = scanner->caps[scanner->source].pos_x;
if (x_off > (unsigned int)scanner->caps[scanner->source].width) {
w = scanner->caps[scanner->source].width;
rx,
ry,
rw,
rh);
x_off = rx;
if (x_off > (unsigned int)rw) {
w = rw;
x_off = 0;
}
else
w = scanner->caps[scanner->source].width - x_off;
y_off = scanner->caps[scanner->source].pos_y;
if(y_off > (unsigned int)scanner->caps[scanner->source].height) {
h = scanner->caps[scanner->source].height;
w = rw - x_off;
y_off = ry;
if(y_off > (unsigned int)rh) {
h = rh;
y_off = 0;
}
else
h = scanner->caps[scanner->source].height - y_off;
h = rh - y_off;
DBG(10, "2-JPEF Geometry [%dx%d|%dx%d]\n",
x_off,
y_off,
w,
h);
surface = malloc(w * h * cinfo.output_components);
jpeg_start_decompress(&cinfo);
if (x_off > 0 || w < cinfo.output_width)
jpeg_crop_scanline(&cinfo, &x_off, &w);
lineSize = w * cinfo.output_components;
if (y_off > 0)
jpeg_skip_scanlines(&cinfo, y_off);
surface = malloc(cinfo.output_width * cinfo.output_height * cinfo.output_components);
if (surface == NULL) {
jpeg_destroy_decompress(&cinfo);
DBG( 1, "Escl Jpeg : Memory allocation problem\n");
@ -235,14 +248,8 @@ get_JPEG_data(capabilities_t *scanner, int *width, int *height, int *bps)
}
return (SANE_STATUS_NO_MEM);
}
jpeg_start_decompress(&cinfo);
if (x_off > 0 || w < cinfo.output_width)
jpeg_crop_scanline(&cinfo, &x_off, &w);
lineSize = w * cinfo.output_components;
if (y_off > 0)
jpeg_skip_scanlines(&cinfo, y_off);
pos = 0;
while (cinfo.output_scanline < (unsigned int)scanner->caps[scanner->source].height) {
while (cinfo.output_scanline < (unsigned int)rh) {
rowptr[0] = (JSAMPROW)surface + (lineSize * pos); // ..cinfo.output_scanline);
jpeg_read_scanlines(&cinfo, rowptr, (JDIMENSION) 1);
pos++;
@ -253,7 +260,7 @@ get_JPEG_data(capabilities_t *scanner, int *width, int *height, int *bps)
*width = w;
*height = h;
*bps = cinfo.output_components;
jpeg_finish_decompress(&cinfo);
// jpeg_finish_decompress(&cinfo);
jpeg_destroy_decompress(&cinfo);
fclose(scanner->tmp);
scanner->tmp = NULL;

Wyświetl plik

@ -46,7 +46,7 @@ struct downloading
static const char settings[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" \
"<scan:ScanSettings xmlns:pwg=\"http://www.pwg.org/schemas/2010/12/sm\" xmlns:scan=\"http://schemas.hp.com/imaging/escl/2011/05/03\">" \
" <pwg:Version>2.0</pwg:Version>" \
" <pwg:Version>%s</pwg:Version>" \
" <pwg:ScanRegions>" \
" <pwg:ScanRegion>" \
" <pwg:ContentRegionUnits>escl:ThreeHundredthsOfInches</pwg:ContentRegionUnits>" \
@ -56,13 +56,11 @@ static const char settings[] =
" <pwg:YOffset>%d</pwg:YOffset>" \
" </pwg:ScanRegion>" \
" </pwg:ScanRegions>" \
" <pwg:DocumentFormat>%s</pwg:DocumentFormat>" \
"%s" \
" <scan:ColorMode>%s</scan:ColorMode>" \
" <scan:XResolution>%d</scan:XResolution>" \
" <scan:YResolution>%d</scan:YResolution>" \
" <pwg:InputSource>%s</pwg:InputSource>" \
" <scan:InputSource>%s</scan:InputSource>" \
"%s" \
"%s" \
"</scan:ScanSettings>";
@ -138,8 +136,8 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st
char *location = NULL;
char *result = NULL;
char *temporary = NULL;
char *f_ext = "";
char *format_ext = NULL;
char f_ext_tmp[1024];
char duplex_mode[1024] = { 0 };
int wakup_count = 0;
@ -170,35 +168,38 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st
int have_tiff = scanner->caps[scanner->source].have_tiff;
int have_pdf = scanner->caps[scanner->source].have_pdf;
if ((scanner->source == PLATEN && have_pdf == -1) ||
(scanner->source > PLATEN)) {
if (have_tiff != -1) {
scanner->caps[scanner->source].default_format =
strdup(scanner->caps[scanner->source].DocumentFormats[have_tiff]);
}
else if (have_png != -1) {
scanner->caps[scanner->source].default_format =
strdup(scanner->caps[scanner->source].DocumentFormats[have_png]);
}
else if (have_jpeg != -1) {
scanner->caps[scanner->source].default_format =
strdup(scanner->caps[scanner->source].DocumentFormats[have_jpeg]);
}
if (have_pdf != -1) {
scanner->caps[scanner->source].default_format =
strdup(scanner->caps[scanner->source].DocumentFormats[have_pdf]);
}
else {
else if (have_tiff != -1) {
scanner->caps[scanner->source].default_format =
strdup(scanner->caps[scanner->source].DocumentFormats[have_pdf]);
strdup(scanner->caps[scanner->source].DocumentFormats[have_tiff]);
}
if (scanner->caps[scanner->source].format_ext == 1)
else if (have_png != -1) {
scanner->caps[scanner->source].default_format =
strdup(scanner->caps[scanner->source].DocumentFormats[have_png]);
}
else if (have_jpeg != -1) {
scanner->caps[scanner->source].default_format =
strdup(scanner->caps[scanner->source].DocumentFormats[have_jpeg]);
}
if (atof ((const char *)device->version) <= 2.0)
{
char f_ext_tmp[1024];
// For eSCL 2.0 and older clients
snprintf(f_ext_tmp, sizeof(f_ext_tmp),
" <pwg:DocumentFormat>%s</pwg:DocumentFormat>",
scanner->caps[scanner->source].default_format);
}
else
{
// For eSCL 2.1 and newer clients
snprintf(f_ext_tmp, sizeof(f_ext_tmp),
" <scan:DocumentFormatExt>%s</scan:DocumentFormatExt>",
scanner->caps[scanner->source].default_format);
format_ext = f_ext_tmp;
}
else
format_ext = f_ext;
format_ext = f_ext_tmp;
if(scanner->source > PLATEN && scanner->Sources[ADFDUPLEX]) {
snprintf(duplex_mode, sizeof(duplex_mode),
" <scan:Duplex>%s</scan:Duplex>",
@ -215,52 +216,63 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st
char *source = (scanner->source == PLATEN ? "Platen" : "Feeder");
if (scanner->use_threshold)
{
char *tmp = add_support_option("ThresholdSupport", scanner->val_threshold);
if (support_options[0])
strcat(support_options, tmp);
else
strcpy(support_options, tmp);
free(tmp);
if (scanner->val_threshold != scanner->threshold->value)
{
char *tmp = add_support_option("ThresholdSupport", scanner->val_threshold);
if (support_options[0])
strcat(support_options, tmp);
else
strcpy(support_options, tmp);
free(tmp);
}
}
if (scanner->use_sharpen)
{
char *tmp = add_support_option("SharpenSupport", scanner->val_sharpen);
if (support_options[0])
strcat(support_options, tmp);
else
strcpy(support_options, tmp);
free(tmp);
if (scanner->val_sharpen != scanner->sharpen->value)
{
char *tmp = add_support_option("SharpenSupport", scanner->val_sharpen);
if (support_options[0])
strcat(support_options, tmp);
else
strcpy(support_options, tmp);
free(tmp);
}
}
if (scanner->use_contrast)
{
char *tmp = add_support_option("ContrastSupport", scanner->val_contrast);
if (support_options[0])
strcat(support_options, tmp);
else
strcpy(support_options, tmp);
free(tmp);
if (scanner->val_contrast != scanner->contrast->value)
{
char *tmp = add_support_option("ContrastSupport", scanner->val_contrast);
if (support_options[0])
strcat(support_options, tmp);
else
strcpy(support_options, tmp);
free(tmp);
}
}
if (scanner->use_brightness)
{
char *tmp = add_support_option("BrightnessSupport", scanner->val_brightness);
if (support_options[0])
strcat(support_options, tmp);
else
strcpy(support_options, tmp);
free(tmp);
if (scanner->val_brightness != scanner->brightness->value)
{
char *tmp = add_support_option("BrightnessSupport", scanner->val_brightness);
if (support_options[0])
strcat(support_options, tmp);
else
strcpy(support_options, tmp);
free(tmp);
}
}
snprintf(cap_data, sizeof(cap_data), settings,
device->version,
scanner->caps[scanner->source].height,
scanner->caps[scanner->source].width,
off_x,
off_y,
scanner->caps[scanner->source].default_format,
format_ext,
scanner->caps[scanner->source].default_color,
scanner->caps[scanner->source].default_resolution,
scanner->caps[scanner->source].default_resolution,
source,
source,
duplex_mode[0] == 0 ? " " : duplex_mode,
support_options[0] == 0 ? " " : support_options);
upload->memory = strdup(cap_data);
@ -277,6 +289,8 @@ wake_up_device:
curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDSIZE, upload->size);
curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, download_callback);
curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, (void *)download);
curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 3L);
CURLcode res = curl_easy_perform(curl_handle);
if (res != CURLE_OK) {
DBG( 1, "Create NewJob : the scanner responded incorrectly: %s\n", curl_easy_strerror(res));
@ -296,7 +310,17 @@ wake_up_device:
result = strdup(location);
DBG( 1, "Create NewJob : %s\n", result);
*temporary = '\n';
*location = '\0';
location = strrchr(tmp_location,'/');
wakup_count = 0;
if (location) {
location++;
scanner->scanJob = strdup(location);
DBG( 1, "Full location header [%s]\n", scanner->scanJob);
}
else
scanner->scanJob = strdup("ScanJobs");
*location = '/';
}
}
if (result == NULL) {

Wyświetl plik

@ -44,8 +44,9 @@
#if HAVE_POPPLER_GLIB
#define INPUT_BUFFER_SIZE 4096
#define ESCL_PDF_USE_MAPPED_FILE POPPLER_CHECK_VERSION(0,82,0)
#if ! ESCL_PDF_USE_MAPPED_FILE
static unsigned char*
set_file_in_buffer(FILE *fp, int *size)
{
@ -70,6 +71,7 @@ set_file_in_buffer(FILE *fp, int *size)
*size = nx;
return data;
}
#endif
static unsigned char *
cairo_surface_to_pixels (cairo_surface_t *surface, int bps)
@ -109,29 +111,53 @@ get_PDF_data(capabilities_t *scanner, int *width, int *height, int *bps)
PopplerPage *page;
PopplerDocument *doc;
double dw, dh;
int w, h, size = 0;
char *data = NULL;
int w, h;
unsigned char* surface = NULL;
SANE_Status status = SANE_STATUS_GOOD;
#if ESCL_PDF_USE_MAPPED_FILE
GMappedFile *file;
GBytes *bytes;
data = (char*)set_file_in_buffer(scanner->tmp, &size);
if (!data) {
DBG(1, "Error : poppler_document_new_from_data");
file = g_mapped_file_new_from_fd (fileno (scanner->tmp), 0, NULL);
if (!file) {
DBG(1, "Error : g_mapped_file_new_from_fd");
status = SANE_STATUS_INVAL;
goto close_file;
}
doc = poppler_document_new_from_data(data,
size,
NULL,
NULL);
if (!doc) {
DBG(1, "Error : poppler_document_new_from_data");
bytes = g_mapped_file_get_bytes (file);
if (!bytes) {
DBG(1, "Error : g_mapped_file_get_bytes");
status = SANE_STATUS_INVAL;
goto free_file;
}
doc = poppler_document_new_from_bytes (bytes, NULL, NULL);
if (!doc) {
DBG(1, "Error : poppler_document_new_from_bytes");
status = SANE_STATUS_INVAL;
goto free_bytes;
}
#else
int size = 0;
char *data = NULL;
data = (char*)set_file_in_buffer(scanner->tmp, &size);
if (!data) {
DBG(1, "Error : set_file_in_buffer");
status = SANE_STATUS_INVAL;
goto close_file;
}
doc = poppler_document_new_from_data (data, size, NULL, NULL);
if (!doc) {
DBG(1, "Error : poppler_document_new_from_data");
status = SANE_STATUS_INVAL;
goto free_data;
}
#endif
page = poppler_document_get_page (doc, 0);
if (!page) {
DBG(1, "Error : poppler_document_get_page");
@ -201,8 +227,15 @@ free_page:
g_object_unref (page);
free_doc:
g_object_unref (doc);
#if ESCL_PDF_USE_MAPPED_FILE
free_bytes:
g_bytes_unref (bytes);
free_file:
g_mapped_file_unref (file);
#else
free_data:
free(data);
#endif
close_file:
if (scanner->tmp)
fclose(scanner->tmp);

Wyświetl plik

@ -44,10 +44,35 @@ write_callback(void __sane_unused__*str,
* This function is called in the 'sane_cancel' function.
*/
void
escl_scanner(const ESCL_Device *device, char *result)
escl_delete(const ESCL_Device *device, char *uri)
{
CURL *curl_handle = NULL;
const char *scan_jobs = "/eSCL/ScanJobs";
long answer = 0;
if (uri == NULL)
return;
curl_handle = curl_easy_init();
if (curl_handle != NULL) {
escl_curl_url(curl_handle, device, uri);
curl_easy_setopt(curl_handle, CURLOPT_CUSTOMREQUEST, "DELETE");
if (curl_easy_perform(curl_handle) == CURLE_OK) {
curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &answer);
return;
}
curl_easy_cleanup(curl_handle);
}
}
/**
* \fn void escl_scanner(const ESCL_Device *device, char *result)
* \brief Function that resets the scanner after each scan, using curl.
* This function is called in the 'sane_cancel' function.
*/
void
escl_scanner(const ESCL_Device *device, char *scanJob, char *result, SANE_Bool status)
{
CURL *curl_handle = NULL;
const char *scan_jobs = "/eSCL/";
const char *scanner_start = "/NextDocument";
char scan_cmd[PATH_MAX] = { 0 };
int i = 0;
@ -58,20 +83,27 @@ escl_scanner(const ESCL_Device *device, char *result)
CURL_CALL:
curl_handle = curl_easy_init();
if (curl_handle != NULL) {
snprintf(scan_cmd, sizeof(scan_cmd), "%s%s%s",
scan_jobs, result, scanner_start);
snprintf(scan_cmd, sizeof(scan_cmd), "%s%s%s%s",
scan_jobs, scanJob, result, scanner_start);
escl_curl_url(curl_handle, device, scan_cmd);
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_callback);
curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 3L);
if (curl_easy_perform(curl_handle) == CURLE_OK) {
curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &answer);
i++;
if (i >= 15) return;
}
curl_easy_cleanup(curl_handle);
if (SANE_STATUS_GOOD != escl_status(device,
PLATEN,
NULL,
NULL))
goto CURL_CALL;
char* end = strrchr(scan_cmd, '/');
*end = 0;
escl_delete(device, scan_cmd);
if (status) {
if (SANE_STATUS_GOOD != escl_status(device,
PLATEN,
NULL,
NULL))
goto CURL_CALL;
}
}
}

Wyświetl plik

@ -57,10 +57,10 @@ write_callback(void *str, size_t size, size_t nmemb, void *userp)
* \return status (if everything is OK, status = SANE_STATUS_GOOD, otherwise, SANE_STATUS_NO_MEM/SANE_STATUS_INVAL)
*/
SANE_Status
escl_scan(capabilities_t *scanner, const ESCL_Device *device, char *result)
escl_scan(capabilities_t *scanner, const ESCL_Device *device, char *scanJob, char *result)
{
CURL *curl_handle = NULL;
const char *scan_jobs = "/eSCL/ScanJobs";
const char *scan_jobs = "/eSCL/";
const char *scanner_start = "/NextDocument";
char scan_cmd[PATH_MAX] = { 0 };
SANE_Status status = SANE_STATUS_GOOD;
@ -70,10 +70,12 @@ escl_scan(capabilities_t *scanner, const ESCL_Device *device, char *result)
scanner->real_read = 0;
curl_handle = curl_easy_init();
if (curl_handle != NULL) {
snprintf(scan_cmd, sizeof(scan_cmd), "%s%s%s",
scan_jobs, result, scanner_start);
snprintf(scan_cmd, sizeof(scan_cmd), "%s%s%s%s",
scan_jobs, scanJob, result, scanner_start);
escl_curl_url(curl_handle, device, scan_cmd);
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_callback);
curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 3L);
if (scanner->tmp)
fclose(scanner->tmp);
scanner->tmp = tmpfile();
@ -82,6 +84,7 @@ escl_scan(capabilities_t *scanner, const ESCL_Device *device, char *result)
CURLcode res = curl_easy_perform(curl_handle);
if (res != CURLE_OK) {
DBG( 1, "Unable to scan: %s\n", curl_easy_strerror(res));
scanner->real_read = 0;
fclose(scanner->tmp);
scanner->tmp = NULL;
status = SANE_STATUS_INVAL;

Wyświetl plik

@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <libxml/parser.h>
@ -220,6 +221,8 @@ reload:
escl_curl_url(curl_handle, device, scanner_status);
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, memory_callback_s);
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)var);
curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 3L);
CURLcode res = curl_easy_perform(curl_handle);
if (res != CURLE_OK) {
DBG( 1, "The scanner didn't respond: %s\n", curl_easy_strerror(res));
@ -268,3 +271,135 @@ clean_data:
}
return (status);
}
static void
print_xml_job_finish(xmlNode *node,
SANE_Status *job)
{
while (node) {
if (node->type == XML_ELEMENT_NODE) {
if (find_nodes_s(node)) {
if (strcmp((const char *)node->name, "JobState") == 0) {
const char *state = (const char *)xmlNodeGetContent(node);
if (!strcmp(state, "Canceled")) {
*job = SANE_STATUS_GOOD;
DBG(10, "jobId Completed SANE_STATUS_GOOD\n");
}
else if (!strcmp(state, "Aborted")) {
*job = SANE_STATUS_GOOD;
DBG(10, "jobId Completed SANE_STATUS_GOOD\n");
}
else if (!strcmp(state, "Completed")) {
*job = SANE_STATUS_GOOD;
DBG(10, "jobId Completed SANE_STATUS_GOOD\n");
}
}
}
}
print_xml_job_finish(node->children, job);
node = node->next;
}
}
static void
print_xml_reset_all_jobs (xmlNode *node,
ESCL_Device *device)
{
DBG(10, "print_xml_reset_all_jobs\n");
SANE_Status status = SANE_STATUS_DEVICE_BUSY;
while (node) {
if (node->type == XML_ELEMENT_NODE) {
if (find_nodes_s(node)) {
if (strcmp((const char *)node->name, "JobUri") == 0) {
DBG(10, "print_xml_reset_all_jobs: %s\n", node->name);
if (device != NULL) {
print_xml_job_finish (node, &status);
if (status == SANE_STATUS_DEVICE_BUSY) {
char *jobUri = (char *)xmlNodeGetContent(node);
char *job = strrchr((const char *)jobUri, '/');
char *scanj = NULL;
if (job != NULL) {
if (strstr(jobUri,"ScanJobs"))
scanj = strdup("ScanJobs");
else
scanj = strdup("ScanJob");
DBG(10, "print_xml_reset_all_jobs: %s/%s\n", scanj, job);
escl_scanner(device, scanj, job, SANE_FALSE);
free(scanj);
}
DBG(10, "print_xml_reset_all_jobs: sleep to finish the job\n");
}
}
}
}
}
print_xml_reset_all_jobs (node->children,
device);
node = node->next;
}
}
/**
* \fn SANE_Status escl_reset_all_jobs (ESCL_Device *device, , char *scanJob)
* \brief Function that forces the end of jobs, using curl.
* This function is called in the 'sane_start' function.
*
* \return status (if everything is OK, status = SANE_STATUS_GOOD, otherwise, SANE_STATUS_NO_MEM/SANE_STATUS_INVAL)
*/
SANE_Status
escl_reset_all_jobs(ESCL_Device *device)
{
CURL *curl_handle = NULL;
xmlDoc *data = NULL;
xmlNode *node = NULL;
struct idle *var = NULL;
const char *scanner_status = "/eSCL/ScannerStatus";
SANE_Status status = SANE_STATUS_DEVICE_BUSY;
DBG(10, "escl_reset_all_jobs\n");
if (device == NULL)
return (SANE_STATUS_NO_MEM);
DBG(10, "1 - escl_reset_all_jobs\n");
var = (struct idle*)calloc(1, sizeof(struct idle));
if (var == NULL)
return (SANE_STATUS_NO_MEM);
DBG(10, "2 - escl_reset_all_jobs\n");
var->memory = malloc(1);
var->size = 0;
curl_handle = curl_easy_init();
escl_curl_url(curl_handle, device, scanner_status);
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, memory_callback_s);
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)var);
curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 3L);
CURLcode res = curl_easy_perform(curl_handle);
if (res != CURLE_OK) {
DBG( 1, "The scanner didn't respond: %s\n", curl_easy_strerror(res));
status = SANE_STATUS_INVAL;
goto clean_data1;
}
DBG(10, "3 - escl_reset_all_jobs\n");
DBG( 10, "eSCL : Status : %s.\n", var->memory);
data = xmlReadMemory(var->memory, var->size, "file.xml", NULL, 0);
if (data == NULL) {
status = SANE_STATUS_NO_MEM;
goto clean_data1;
}
node = xmlDocGetRootElement(data);
if (node == NULL) {
status = SANE_STATUS_NO_MEM;
goto clean1;
}
print_xml_reset_all_jobs (node, device);
status = SANE_STATUS_GOOD;
clean1:
xmlFreeDoc(data);
clean_data1:
xmlCleanupParser();
xmlMemoryDump();
curl_easy_cleanup(curl_handle);
free(var->memory);
free(var);
return status;
}

Wyświetl plik

@ -26,6 +26,8 @@
#include "escl.h"
#include "../include/_stdint.h"
#include "../include/sane/sanei.h"
#include <stdio.h>
@ -53,11 +55,11 @@ SANE_Status
get_TIFF_data(capabilities_t *scanner, int *width, int *height, int *bps)
{
TIFF* tif = NULL;
uint32 w = 0;
uint32 h = 0;
uint32_t w = 0;
uint32_t h = 0;
unsigned char *surface = NULL; /* image data*/
int components = 4;
uint32 npixels = 0;
uint32_t npixels = 0;
SANE_Status status = SANE_STATUS_GOOD;
lseek(fileno(scanner->tmp), 0, SEEK_SET);
@ -71,15 +73,15 @@ get_TIFF_data(capabilities_t *scanner, int *width, int *height, int *bps)
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w);
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h);
npixels = w * h;
surface = (unsigned char*) malloc(npixels * sizeof (uint32));
if (surface != NULL)
surface = (unsigned char*) malloc(npixels * sizeof (uint32_t));
if (surface == NULL)
{
DBG( 1, "Escl Tiff : raster Memory allocation problem.\n");
status = SANE_STATUS_INVAL;
goto close_tiff;
}
if (!TIFFReadRGBAImage(tif, w, h, (uint32 *)surface, 0))
if (!TIFFReadRGBAImage(tif, w, h, (uint32_t *)surface, 0))
{
DBG( 1, "Escl Tiff : Problem reading image data.\n");
status = SANE_STATUS_INVAL;

Wyświetl plik

@ -140,9 +140,12 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
#define IN_periph_devtype_unknown 0x1f
#define get_IN_response_format(in) getbitfield(in + 0x03, 0x07, 0)
#define IN_recognized 0x02
#define get_IN_vendor(in, buf) strncpy(buf, (char *)in + 0x08, 0x08)
#define get_IN_product(in, buf) strncpy(buf, (char *)in + 0x10, 0x010)
#define get_IN_version(in, buf) strncpy(buf, (char *)in + 0x20, 0x04)
#define get_IN_vendor(in, buf) snprintf(buf, 0x08 + 1, "%.*s", \
0x08, (char *)in + 0x08)
#define get_IN_product(in, buf) snprintf(buf, 0x10 + 1, "%.*s", \
0x10, (char *)in + 0x10)
#define get_IN_version(in, buf) snprintf(buf, 0x04 + 1, "%.*s", \
0x04, (char *)in + 0x20)
#define get_IN_color_offset(in) getnbyte (in+0x2A, 2) /* offset between colors */
/* these only in some scanners */

Wyświetl plik

@ -1,12 +1,12 @@
/* sane - Scanner Access Now Easy.
This file is part of the SANE package, and implements a SANE backend
for various Fujitsu scanners.
for various Fujitsu and Ricoh scanners.
Copyright (C) 2000 Randolph Bentson
Copyright (C) 2001 Frederik Ramm
Copyright (C) 2001-2004 Oliver Schirrmeister
Copyright (C) 2003-2019 m. allan noah
Copyright (C) 2003-2023 m. allan noah
JPEG output and low memory usage support funded by:
Archivista GmbH, www.archivista.ch
@ -15,7 +15,7 @@
Automatic length detection support funded by:
Martin G. Miller, mgmiller at optonline.net
Software image enhancement routines and recent scanner support funded by:
Fujitsu Computer Products of America, Inc. www.fcpa.com
PFU America, Inc., fujitsuscanners.com
--------------------------------------------------------------------------
@ -611,6 +611,13 @@
- fix JPEG duplex memory corruption
- change window_gamma init (fixes bright/contrast for iX1500)
- only call send_lut after set_window (remove late_lut)
v138 2022-06-01, MAN
- minor updates to company name (FCPA -> PFU)
v139 2022-11-15, MAN
- move updated window_gamma logic to set_window
- use internal gamma table if possible (fixes #618)
v140 2023-03-27, MAN
- add initial support for Ricoh scanners
SANE FLOW DIAGRAM
@ -660,7 +667,7 @@
#include "fujitsu.h"
#define DEBUG 1
#define BUILD 137
#define BUILD 140
/* values for SANE_DEBUG_FUJITSU env var:
- errors 5
@ -764,16 +771,16 @@ static struct fujitsu *fujitsu_devList = NULL;
SANE_Status
sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
{
authorize = authorize; /* get rid of compiler warning */
(void) authorize; /* get rid of compiler warning */
DBG_INIT ();
DBG (10, "sane_init: start\n");
if (version_code)
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, V_MINOR, BUILD);
*version_code = SANE_VERSION_CODE (SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD);
DBG (5, "sane_init: fujitsu backend %d.%d.%d, from %s\n",
SANE_CURRENT_MAJOR, V_MINOR, BUILD, PACKAGE_STRING);
SANE_CURRENT_MAJOR, SANE_CURRENT_MINOR, BUILD, PACKAGE_STRING);
sanei_magic_init();
@ -819,7 +826,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
int num_devices=0;
int i=0;
local_only = local_only; /* get rid of compiler warning */
(void) local_only; /* get rid of compiler warning */
DBG (10, "sane_get_devices: start\n");
@ -1149,7 +1156,7 @@ connect_fd (struct fujitsu *s)
}
/*
* This routine will check if a certain device is a Fujitsu scanner
* This routine will check if a certain device is a Fujitsu/Ricoh scanner
* It also copies interesting data from INQUIRY into the handle structure
*/
static SANE_Status
@ -1204,9 +1211,9 @@ init_inquire (struct fujitsu *s)
for (i = 3; s->version_name[i] == ' ' && i >= 0; i--)
s->version_name[i] = 0;
if (strcmp ("FUJITSU", s->vendor_name)) {
if (strcmp ("FUJITSU", s->vendor_name) && strcmp ("RICOH", s->vendor_name)) {
DBG (5, "The device at '%s' is reported to be made by '%s'\n", s->device_name, s->vendor_name);
DBG (5, "This backend only supports Fujitsu products.\n");
DBG (5, "This backend only supports Fujitsu and Ricoh products.\n");
return SANE_STATUS_INVAL;
}
@ -2107,12 +2114,6 @@ init_model (struct fujitsu *s)
s->ppl_mod_by_mode[MODE_GRAYSCALE] = 1;
s->ppl_mod_by_mode[MODE_COLOR] = 1;
/* we prefer to use the downloaded (LUT) gamma table (0x80) if possible.
* but if scanner has only built-in gamma tables, we use the first one (0) */
if (s->num_download_gamma){
s->window_gamma = 0x80;
}
/* endorser type tells string length (among other things) */
if(s->has_endorser_b){
/*old-style is 40 bytes*/
@ -2206,7 +2207,10 @@ init_model (struct fujitsu *s)
s->color_interlace = COLOR_INTERLACE_3091;
s->duplex_interlace = DUPLEX_INTERLACE_3091;
s->ghs_in_rs = 1;
s->window_gamma = 0;
/* might be inaccurate */
s->num_internal_gamma = 1;
s->num_download_gamma = 0;
s->reverse_by_mode[MODE_LINEART] = 1;
s->reverse_by_mode[MODE_HALFTONE] = 1;
@ -7055,12 +7059,11 @@ sane_start (SANE_Handle handle)
goto errors;
}
/* send lut if scanner has no hardware brightness/contrast,
* or we are going to ask it to use a downloaded gamma table */
if (!s->brightness_steps || !s->contrast_steps || s->window_gamma & 0x80){
/* send lut if set_window said we would */
if ( s->window_gamma ){
ret = send_lut(s);
if (ret != SANE_STATUS_GOOD)
DBG (5, "sane_start: WARNING: cannot late send_lut %d\n", ret);
DBG (5, "sane_start: WARNING: cannot send_lut %d\n", ret);
}
/* some scanners need the q table sent, even when not scanning jpeg */
@ -7614,6 +7617,23 @@ set_window (struct fujitsu *s)
/* the remainder of the block varies based on model and mode,
* except for gamma and paper size, those are in the same place */
/* determine if we need to send gamma LUT.
* send lut if scanner supports it and any of:
* has no hardware brightness but user changed it
* has no hardware contrast but user changed it
* has no internal gamma table */
if ( s->num_download_gamma && (
(!s->brightness_steps && s->brightness != 0)
|| (!s->contrast_steps && s->contrast != 0 )
|| !s->num_internal_gamma
) ){
s->window_gamma = 0x80;
}
/* otherwise, use the internal table */
else{
s->window_gamma = 0;
}
/*vuid c0*/
if(s->has_vuid_3091){
set_WD_vendor_id_code (desc1, WD_VUID_3091);
@ -9270,7 +9290,7 @@ sense_handler (int fd, unsigned char * sensed_data, void *arg)
DBG (5, "sense_handler: start\n");
/* kill compiler warning */
fd = fd;
(void) fd;
/* copy the rs return data into the scanner struct
so that the caller can use it if he wants */
@ -9605,8 +9625,8 @@ do_scsi_cmd(struct fujitsu *s, int runRS, int shortTime,
int ret;
/*shut up compiler*/
runRS=runRS;
shortTime=shortTime;
(void) runRS;
(void) shortTime;
DBG(10, "do_scsi_cmd: start\n");

Wyświetl plik

@ -15,10 +15,10 @@ scsi FUJITSU
# To use a specific scsi device
#scsi /dev/sg1
# For Fujitsu scanners connected via USB on a known device (kernel driver):
# For scanners connected via USB on a known device (kernel driver):
#usb /dev/usb/scanner0
# For Fujitsu scanners connected via USB using vendor and device ids (libusb):
# For scanners connected via USB using vendor and device ids (libusb):
#usb VENDORID PRODUCTID
# NOTE: if you have to add your device here- please send the id and model
@ -264,3 +264,51 @@ usb 0x04c5 0x160a
#fi-7800
usb 0x04c5 0x160b
#ScanSnap iX1600
usb 0x04c5 0x1632
#ScanPartner SP30
usb 0x04c5 0x140a
#fi-7300NX
usb 0x04c5 0x1575
#fi-8190
usb 0x04c5 0x15fd
#fi-8290
usb 0x04c5 0x15fe
#fi-8170
usb 0x04c5 0x15ff
#fi-8270
usb 0x04c5 0x1600
#fi-8150
usb 0x04c5 0x1601
#fi-8250
usb 0x04c5 0x1602
#fi-8150U
usb 0x04c5 0x162d
#fi-8250U
usb 0x04c5 0x162e
#ScanSnap iX1300
usb 0x04c5 0x162c
#ScanSnap iX1400
usb 0x04c5 0x1630
######################################
# Ricoh-only scanners
#fi-8040
usb 0x05ca 0x0307
#fi-70F"
usb 0x05ca 0x0308

Wyświetl plik

@ -325,7 +325,6 @@ struct fujitsu
int jpeg_interlace; /* different models interlace jpeg sides differently */
int cropping_mode; /* lower-end scanners don't crop from paper size */
int ghs_in_rs;
int window_gamma;
int endorser_string_len;
int has_pixelsize;
int has_short_pixelsize; /* m3091/2 put weird stuff at end, ignore it */
@ -520,6 +519,7 @@ struct fujitsu
/* the user never directly modifies these */
int s_mode; /*color,lineart,etc: sent to scanner*/
int window_gamma; /* depends on brightness/contrast and lut */
/* this is defined in sane spec as a struct containing:
SANE_Frame format;

Wyświetl plik

@ -131,6 +131,9 @@ usb 0x07b3 0x0900
# Plustek OpticFilm 7200
usb 0x07b3 0x0807
# Plustek OpticFilm 7200 V2
usb 0x07b3 0x0c07
# Plustek OpticFilm 7200i
usb 0x07b3 0x0c04
@ -143,6 +146,12 @@ usb 0x07b3 0x0c3a
# Plustek OpticFilm 7500i
usb 0x07b3 0x0c13
# Plustek OpticFilm 7600i
usb 0x07b3 0x0c3b
# Plustek OpticFilm 8100
usb 0x07b3 0x130c
# Plustek OpticFilm 8200i
usb 0x07b3 0x130d
@ -157,3 +166,6 @@ usb 0x1803 0x162e
# Plustek OpticBook 3800
usb 0x07b3 0x1300
# Plustek OpticFilm 7600i
usb 0x07b3 0x0c3b

Wyświetl plik

@ -16,27 +16,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
As a special exception, the authors of SANE give permission for
additional uses of the libraries contained in this release of SANE.
The exception is that, if you link a SANE library with other files
to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public
License. Your use of that executable is in no way restricted on
account of linking the SANE library code into it.
This exception does not, however, invalidate any other reasons why
the executable file might be covered by the GNU General Public
License.
If you submit changes to SANE to the maintainers to be included in
a subsequent release, you agree by submitting the changes that
those changes may be distributed with this exception intact.
If you write modifications of your own for SANE, it is your choice
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice.
*/
#ifndef BACKEND_GENESYS_CALIBRATION_H

Wyświetl plik

@ -16,27 +16,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
As a special exception, the authors of SANE give permission for
additional uses of the libraries contained in this release of SANE.
The exception is that, if you link a SANE library with other files
to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public
License. Your use of that executable is in no way restricted on
account of linking the SANE library code into it.
This exception does not, however, invalidate any other reasons why
the executable file might be covered by the GNU General Public
License.
If you submit changes to SANE to the maintainers to be included in
a subsequent release, you agree by submitting the changes that
those changes may be distributed with this exception intact.
If you write modifications of your own for SANE, it is your choice
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice.
*/
#ifndef BACKEND_GENESYS_COMMAND_SET_H

Wyświetl plik

@ -16,27 +16,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
As a special exception, the authors of SANE give permission for
additional uses of the libraries contained in this release of SANE.
The exception is that, if you link a SANE library with other files
to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public
License. Your use of that executable is in no way restricted on
account of linking the SANE library code into it.
This exception does not, however, invalidate any other reasons why
the executable file might be covered by the GNU General Public
License.
If you submit changes to SANE to the maintainers to be included in
a subsequent release, you agree by submitting the changes that
those changes may be distributed with this exception intact.
If you write modifications of your own for SANE, it is your choice
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice.
*/
#define DEBUG_DECLARE_ONLY

Wyświetl plik

@ -16,27 +16,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
As a special exception, the authors of SANE give permission for
additional uses of the libraries contained in this release of SANE.
The exception is that, if you link a SANE library with other files
to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public
License. Your use of that executable is in no way restricted on
account of linking the SANE library code into it.
This exception does not, however, invalidate any other reasons why
the executable file might be covered by the GNU General Public
License.
If you submit changes to SANE to the maintainers to be included in
a subsequent release, you agree by submitting the changes that
those changes may be distributed with this exception intact.
If you write modifications of your own for SANE, it is your choice
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice.
*/
#ifndef BACKEND_GENESYS_DEVICE_H

Wyświetl plik

@ -16,27 +16,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
As a special exception, the authors of SANE give permission for
additional uses of the libraries contained in this release of SANE.
The exception is that, if you link a SANE library with other files
to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public
License. Your use of that executable is in no way restricted on
account of linking the SANE library code into it.
This exception does not, however, invalidate any other reasons why
the executable file might be covered by the GNU General Public
License.
If you submit changes to SANE to the maintainers to be included in
a subsequent release, you agree by submitting the changes that
those changes may be distributed with this exception intact.
If you write modifications of your own for SANE, it is your choice
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice.
*/
#define DEBUG_DECLARE_ONLY
@ -279,6 +258,7 @@ std::ostream& operator<<(std::ostream& out, GpioId id)
case GpioId::CANON_8600F: out << "CANON_8600F"; break;
case GpioId::DP665: out << "DP665"; break;
case GpioId::DP685: out << "DP685"; break;
case GpioId::G4010: out << "G4010"; break;
case GpioId::G4050: out << "G4050"; break;
case GpioId::HP2300: out << "HP2300"; break;
case GpioId::HP2400: out << "HP2400"; break;

Wyświetl plik

@ -16,27 +16,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
As a special exception, the authors of SANE give permission for
additional uses of the libraries contained in this release of SANE.
The exception is that, if you link a SANE library with other files
to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public
License. Your use of that executable is in no way restricted on
account of linking the SANE library code into it.
This exception does not, however, invalidate any other reasons why
the executable file might be covered by the GNU General Public
License.
If you submit changes to SANE to the maintainers to be included in
a subsequent release, you agree by submitting the changes that
those changes may be distributed with this exception intact.
If you write modifications of your own for SANE, it is your choice
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice.
*/
#ifndef BACKEND_GENESYS_ENUMS_H
@ -372,6 +351,7 @@ enum class GpioId : unsigned
DP665,
DP685,
G4050,
G4010,
HP2300,
HP2400,
HP3670,
@ -525,6 +505,9 @@ enum class ModelFlag : unsigned
// disable fast feeding mode on this scanner
DISABLE_FAST_FEEDING = 1 << 14,
// scan gray scans as color and combine on host side
HOST_SIDE_GRAY = 1 << 15,
// the scanner uses multi-segment sensors that must be handled during calibration
SIS_SENSOR = 1 << 16,

Wyświetl plik

@ -16,27 +16,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
As a special exception, the authors of SANE give permission for
additional uses of the libraries contained in this release of SANE.
The exception is that, if you link a SANE library with other files
to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public
License. Your use of that executable is in no way restricted on
account of linking the SANE library code into it.
This exception does not, however, invalidate any other reasons why
the executable file might be covered by the GNU General Public
License.
If you submit changes to SANE to the maintainers to be included in
a subsequent release, you agree by submitting the changes that
those changes may be distributed with this exception intact.
If you write modifications of your own for SANE, it is your choice
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice.
*/
#define DEBUG_DECLARE_ONLY

Wyświetl plik

@ -16,27 +16,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
As a special exception, the authors of SANE give permission for
additional uses of the libraries contained in this release of SANE.
The exception is that, if you link a SANE library with other files
to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public
License. Your use of that executable is in no way restricted on
account of linking the SANE library code into it.
This exception does not, however, invalidate any other reasons why
the executable file might be covered by the GNU General Public
License.
If you submit changes to SANE to the maintainers to be included in
a subsequent release, you agree by submitting the changes that
those changes may be distributed with this exception intact.
If you write modifications of your own for SANE, it is your choice
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice.
*/
#ifndef BACKEND_GENESYS_ERROR_H

Wyświetl plik

@ -16,27 +16,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
As a special exception, the authors of SANE give permission for
additional uses of the libraries contained in this release of SANE.
The exception is that, if you link a SANE library with other files
to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public
License. Your use of that executable is in no way restricted on
account of linking the SANE library code into it.
This exception does not, however, invalidate any other reasons why
the executable file might be covered by the GNU General Public
License.
If you submit changes to SANE to the maintainers to be included in
a subsequent release, you agree by submitting the changes that
those changes may be distributed with this exception intact.
If you write modifications of your own for SANE, it is your choice
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice.
*/
#ifndef BACKEND_GENESYS_FWD_H
@ -80,7 +59,7 @@ struct Pixel;
struct RawPixel;
// low.h
struct UsbDeviceEntry;
class UsbDeviceEntry;
// motor.h
struct Genesys_Motor;

Some files were not shown because too many files have changed in this diff Show More