scanline icon indicating copy to clipboard operation
scanline copied to clipboard

Scan fails with -mono

Open ed2050 opened this issue 9 months ago • 3 comments

Hi, this tool is exactly what I need to scan loads of old papers. Thank you for making this. 🙏 😄 At the moment it doesn't work quite right though...

Installed latest scanline binary from pkg. It finds the scanner ok:

> scanline -list
Available scanners:
* HP Officejet 4630 series [6A18B8]

Scanning seems to mostly work. If I do scanline -resolution 200 -verbose then all is fine. It scans from doc feeder and saves to ~/Documents/Archives.

However sometimes there are errors. Notably:

  1. The -mono flag gives errors. Verbose output shows it finding the device, but something fails when it tries to scan:
> scanline -scanner 'HP Officejet 4630 series [6A18B8]' -mono -resolution 200 -verbose
... lots of device messages ...
Configuring scanner
Configuring Document Feeder
Starting scan...
didEncounterError: An error occurred during scanning.
Failed to scan document.
Done

And that's it. No docs are created in ~/Documents/Archive from above command.

Scanner is HP OfficeJet 4630 accessed on local wifi network. Two different macs recognize the scanner. Scanning from document feeder works fine with Image Capture app (b&w or color).

Any idea what's going on? Color files are twice as large as b&w, I'd really like to get it working.

  1. Another minor issue - Running scanline without any docs in the feeder produces a blank 1-page file in Archives. I discovered this accidentally when trying to display help with scanline -h. As far as I can tell, the OfficeJet scanner never makes any noise and is not accessed. scanline just creates an empty file. Wouldn't it be preferable to not to create any files in this case?

Complete output

> scanline -scanner 'HP Officejet 4630 series [6A18B8]' -mono -resolution 200 -verbose
Browsing for scanners.
Waiting up to 10.0 seconds to find scanners
Added device: 
ICScannerDevice <0x7fa70ee11a60>:
  delegate                      : <0x0>
  deviceRef                     : 0x10000125
  connectionID                  : 0x00000000
  deviceID                      : 0x00000000
  name                          : HP Officejet 4630 series [6A18B8]
  locationDescription           : 6A18B8
  iconPath                      : /System/Library/Image Capture/Devices/AirScanScanner.app/Contents/Resources/GenericAirScanScanner.icns
  softwareInstallPercentDone    : 100.000000
  modulePath                    : /System/Library/Image Capture/Devices/AirScanScanner.app
  moduleVersion                 : (null)
  moduleExecutableArchitecture  : 0
  type                          : 0x00000402
  UUIDString                    : 1C852A4D-B800-1F08-ABCD-8CDCD46A18B8
  persistentIDString            : 1C852A4D-B800-1F08-ABCD-8CDCD46A18B8
  autolaunchApplicationPath     : 
  capabilities                  : 
  shared                        : NO
  transportType                 : ICTransportTypeTCPIP
    bonjourServiceType          : _uscan._tcp.
    bonjourServiceName          : HP Officejet 4630 series [6A18B8]
    bonjourTXTRecord            : {
    UUID = {length = 36, bytes = 0x31633835 32613464 2d623830 302d3166 ... 64343661 31386238 };
    adminurl = {length = 28, bytes = 0x68747470 3a2f2f48 50384344 43443436 ... 382e6c6f 63616c2e };
    cs = {length = 22, bytes = 0x62696e6172792c636f6c6f722c677261797363616c65};
    duplex = {length = 1, bytes = 0x46};
    is = {length = 10, bytes = 0x706c6174656e2c616466};
    pdl = {length = 51, bytes = 0x6170706c 69636174 696f6e2f 6f637465 ... 6167652f 6a706567 };
    rs = {length = 5, bytes = 0x2f6553434c};
    txtvers = {length = 1, bytes = 0x31};
    ty = {length = 24, bytes = 0x4850204f66666963656a6574203436333020736572696573};
    vers = {length = 3, bytes = 0x322e30};
}
    ipAddress                   : (null)
    ipPort                      : 0
  availableFunctionalUnitTypes  : 
  selectedFunctionalUnit        : (null) <0x0>
  transferMode                  : ICScannerTransferModeFileBased
  downloadsDirectory            : file:///Users/mark/Pictures/
  documentName                  : Scan
  documentUTI                   : public.tiff

Done searching for scanners
Found scanner: HP Officejet 4630 series [6A18B8]
Opening session with scanner
didOpenSessionWithError: [no error]
deviceDidBecomeReady
didSelectFunctionalUnit:  error: [no error]
didSelectFunctionalUnit: ICScannerFunctionalUnitDocumentFeeder <0x7fa70ef09f30>:
  supportedBitDepths      : <NSMutableIndexSet: 0x7fa70ef0a880>[number of indexes: 1 (in 1 ranges), indexes: (8)]
  bitDepth                : 8
  supportedDocumentTypes  : <NSMutableIndexSet: 0x7fa70ef0d2a0>[number of indexes: 51 (in 10 ranges), indexes: (1-5 7-8 10 13 15-16 22-25 29-33 39-43 48-66 72-78)]
  documentType            : 3
  measurementUnit         : 0
  supportedResolutions    : <NSMutableIndexSet: 0x7fa70ef0a4b0>[number of indexes: 5 (in 5 ranges), indexes: (75 100 200 300 600)]
  preferredResolutions    : <NSMutableIndexSet: 0x7fa70ef0a4b0>[number of indexes: 5 (in 5 ranges), indexes: (75 100 200 300 600)]
  resolution              : 200
  supportedScaleFactors   : <NSMutableIndexSet: 0x7fa70ef0a300>[number of indexes: 1 (in 1 ranges), indexes: (100)]
  preferredScaleFactors   : <NSMutableIndexSet: 0x7fa70ef0a300>[number of indexes: 1 (in 1 ranges), indexes: (100)]
  scaleFactor             : 100
  supportsDuplexScanning  : NO
  duplexScanningEnabled   : NO
  vendorFeatures          : (
    "ICScannerFeatureBoolean <0x7fa70ef0a660>:\n  type                    : ICScannerFeatureTypeBoolean\n  internalName            : EdgeDetection\n  humanReadableName       : Enable edge detection\n  tooltip                 : (null)\n  value                   : NO\n"
)
  state                   : 0x00000001
 error: [no error]
Configuring scanner
Configuring Document Feeder
Starting scan...
didEncounterError: An error occurred during scanning.
Failed to scan document.
Done

ed2050 avatar Apr 29 '24 20:04 ed2050