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.
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
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.
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.
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.
- 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!
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>
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>