plustek backend is limited to 50dpi in Image Capture, but is fine via 8090
patters-match opened this issue · 8 comments
Hi,
After a lot of wrestling with cmake I finally managed to get this cross-compiled for Synology NAS Linux. Some time ago I built a sane-backends package for these devices and their very diverse CPU architectures (7 targets). Ideally I aim to include your software with that package so that sane-supported scanners connected to the NAS work seamlessly with modern Macs.
Using the latest source I encountered an error compiling pdfencoder.cpp: 'runtime_error' is not a member of 'std' which I resolved by adding an include for stdexcept to that source file. I linked to sane-backends version 1.0.28.
AirSane works as described, however I notice that the plustek backend which my own scanner uses (Canon LiDE 20) seems to be limited to 50dpi in macOS Image Capture. The GUI only shows that one value in the resolution dropdown. I notice however that the airsaned local web server does offer resolutions of 50, 300, 600, and 1200dpi. I have verified that acquisition via this method does function correctly all the way to 1200dpi. Typical values 75 and 150 are missing.
Test system:
Mac OS High Sierra 10.13.6, Image Capture 7.0 (1106)
The same behaviour persists using:
Mac OS Mojave 10.14.6, Image Capture 8.0 (1106)
Since the web acquisition method on TCP8090 works, this does suggest the available resolutions are perhaps not being communicated correctly to Image Capture.
Please can you take a look?
Thanks
Patters
Dump of this scanner's options from scanimage:
Options specific to device 'plustek:libusb:001:004':
Scan Mode:
--mode Lineart|Gray|Color [Color]
Selects the scan mode (e.g., lineart, monochrome, or color).
--depth 8|16bit [8]
Number of bits per sample, typical values are 1 for "line-art" and 8
for multibit scans.
--source Normal|Transparency|Negative [inactive]
Selects the scan source (such as a document-feeder).
--resolution 50..1200dpi [50]
Sets the resolution of the scanned image.
--preview[=(yes|no)] [no]
Request a preview-quality scan.
Geometry:
-l 0..215mm [0]
Top-left x position of scan area.
-t 0..297mm [0]
Top-left y position of scan area.
-x 0..215mm [103]
Width of scan-area.
-y 0..297mm [76.21]
Height of scan-area.
Enhancement:
--brightness -100..100% (in steps of 1) [0]
Controls the brightness of the acquired image.
--contrast -100..100% (in steps of 1) [0]
Controls the contrast of the acquired image.
--custom-gamma[=(yes|no)] [no]
Determines whether a builtin or a custom gamma-table should be used.
--gamma-table 0..255,... [inactive]
Gamma-correction table. In color mode this option equally affects the
red, green, and blue channels simultaneously (i.e., it is an intensity
gamma table).
--red-gamma-table 0..255,... [inactive]
Gamma-correction table for the red band.
--green-gamma-table 0..255,... [inactive]
Gamma-correction table for the green band.
--blue-gamma-table 0..255,... [inactive]
Gamma-correction table for the blue band.
Device-Settings:
--lamp-switch[=(yes|no)] [no]
Manually switching the lamp(s).
--lampoff-time 0..999 (in steps of 1) [300]
Lampoff-time in seconds.
--lamp-off-at-exit[=(yes|no)] [yes]
Turn off lamp when program exits
--warmup-time -1..999 (in steps of 1) [inactive]
Warmup-time in seconds.
--lamp-off-during-dcal[=(yes|no)] [inactive]
Always switches lamp off when doing dark calibration.
--calibration-cache[=(yes|no)] [no]
Enables or disables calibration data cache.
--speedup-switch[=(yes|no)] [inactive]
Enables or disables speeding up sensor movement.
--calibrate [inactive]
Performs calibration
Analog frontend:
--red-gain -1..63 (in steps of 1) [-1]
Red gain value of the AFE
--green-gain -1..63 (in steps of 1) [-1]
Green gain value of the AFE
--blue-gain -1..63 (in steps of 1) [-1]
Blue gain value of the AFE
--red-offset -1..63 (in steps of 1) [-1]
Red offset value of the AFE
--green-offset -1..63 (in steps of 1) [-1]
Green offset value of the AFE
--blue-offset -1..63 (in steps of 1) [-1]
Blue offset value of the AFE
--redlamp-off -1..16363 (in steps of 1) [-1]
Defines red lamp off parameter
--greenlamp-off -1..16363 (in steps of 1) [-1]
Defines green lamp off parameter
--bluelamp-off -1..16363 (in steps of 1) [-1]
Defines blue lamp off parameter
Buttons:
Type "scanimage --help -d DEVICE'' to get list of all options for DEVICE.
List of available devices:
plustek:libusb:001:004
Just installed Mopria Scan on Android and it doesn't offer a resolution selector, and it scans at what looks like 50dpi only, just like Image Capture which suggests an AirSane issue. I'll sniff the traffic and get a dump of the XML it sends.
Looks like ScannerCapabilities XML isn't being generated quite right with respect to <scan:SupportedResolutions>. Hopefully this narrows down the issue.
<?xml version="1.0" encoding="UTF-8"?>
<scan:ScannerCapabilities xmlns:scan="http://schemas.hp.com/imaging/escl/2011/05/03" xmlns:pwg="http://www.pwg.org/schemas/2010/12/sm">
<pwg:Version>2.0</pwg:Version>
<pwg:MakeAndModel>Canon CanoScan N670U/N676U/LiDE20</pwg:MakeAndModel>
<scan:UUID>23af8c92-62d2-533a-bc34-195875aded61</scan:UUID>
<scan:Platen>
<scan:PlatenInputCaps>
<scan:MinWidth>0</scan:MinWidth>
<scan:MinHeight>0</scan:MinHeight>
<scan:MaxWidth>2539</scan:MaxWidth>
<scan:MaxHeight>3508</scan:MaxHeight>
<scan:MaxPhysicalWidth>2539</scan:MaxPhysicalWidth>
<scan:MaxPhysicalHeight>3508</scan:MaxPhysicalHeight>
<scan:MaxScanRegions>1</scan:MaxScanRegions>
<scan:SettingProfiles>
<scan:SettingProfile name="0">
<scan:ColorModes>
<scan:ColorMode>Grayscale8</scan:ColorMode>
<scan:ColorMode>Grayscale16</scan:ColorMode>
<scan:ColorMode>RGB24</scan:ColorMode>
<scan:ColorMode>RGB48</scan:ColorMode>
</scan:ColorModes>
<scan:ColorSpaces>
<scan:ColorSpace>grayscale</scan:ColorSpace>
<scan:ColorSpace>color</scan:ColorSpace>
</scan:ColorSpaces>
<scan:SupportedResolutions>
<scan:DiscreteResolutions>
<scan:DiscreteResolution>
<scan:XResolution>50</scan:XResolution>
<scan:YResolution>50</scan:YResolution>
</scan:DiscreteResolution>
</scan:DiscreteResolutions>
</scan:SupportedResolutions>
<scan:DocumentFormats>
<pwg:DocumentFormat>application/pdf</pwg:DocumentFormat>
<pwg:DocumentFormat>image/jpeg</pwg:DocumentFormat>
<pwg:DocumentFormat>image/png</pwg:DocumentFormat>
</scan:DocumentFormats>
</scan:SettingProfile>
</scan:SettingProfiles>
<scan:SupportedIntents>
<scan:SupportedIntent>Preview</scan:SupportedIntent>
<scan:SupportedIntent>TextAndGraphic</scan:SupportedIntent>
<scan:SupportedIntent>Photo</scan:SupportedIntent>
</scan:SupportedIntents>
</scan:PlatenInputCaps>
</scan:Platen>
</scan:ScannerCapabilities>
Thanks for all your effort, it is very appreciated.
I guess the plustek backend reports a resolution range with a quantization of zero, which was not handled correctly in airsaned.
I committed a fix for this and would appreciate if you gave it a try.
Let me know if there are still problems.
Hi,
I can confirm the fix has resolved the issue. Brilliant work on this software by the way, it has reduced SANE from being quite a pain to genuine Plug n Play simplicity. Provided you have a Mac of course :)
Off topic, but are there decent free Windows eSCL clients for this or would I have to use some kind of HP utility from one of their scanner driver bundles?
Ever since I built the sane-backends package for Synology NAS in 2015 I've searched periodically to see if someone had written a working bridge to the macOS Image Capture Architecture. This absence was always quite puzzling given that Apple's ICA API was well over 10 years old even then, dating at least as far back as OS X 10.3 Panther in 2003. Your software, in using the more modern AirScan route, has far exceeded my expectations, and the hotplug support is the icing on the cake. Most SANE frontends don't manage that properly, vastly complicating the whole endeavour for non-technical users when the USB device IDs are incremented.
I will combine AirSane into my sane-backends package for these NAS devices once I've cross-compiled it and all its dependencies for 7 different architectures (!). This should hopefully save a lot of perfectly good equipment needlessly going to landfill.
Thanks again.
Thanks for confirming that it works for you.
I don't know of any free eSCL clients for windows. It would be cool to support the Windows analog to AirScan one day, it's a SOAP based web service interface called "ws-scan", but much more complex than eSCL.
Your project sounds pretty cool, I'm glad you found AirSane useful and are going to include it!
Since AirSane can sometimes crash and since sane-backends are only needed for the dependencies, and are not actually needed to be running, I have decided to make AirSane a package in its own right. This should make things less confusing. You are credited as the author with a link to the GitHub repo.
This is really cool, thanks a lot!