klep / scanline

Command line scanning utility for OSX
MIT License
126 stars 23 forks source link

com.apple.ImageCaptureCore error -9922 #21

Open stuta opened 6 years ago

stuta commented 6 years ago

I always get error -9922 when trying to use this.

./scanline -verbose -browsesecs 1 -jpeg

Searching for available scanners
Waiting up to 1.0 seconds to find scanners
Found scanner: CanoScan LiDE 120
Opening session with scanner
didOpenSessionWithError: [no error]
deviceDidBecomeReady
didSelectFunctionalUnit: ICScannerFunctionalUnitFlatbed <0x7fd9e7e03870>:
  pixelDataType                            : ICScannerPixelDataTypeRGB
  supportedBitDepths                       : <NSMutableIndexSet: 0x7fd9e7e18bf0>[number of indexes: 3 (in 3 ranges), indexes: (1 8 16)]
  bitDepth                                 : 8
  supportedDocumentTypes                   : <NSMutableIndexSet: 0x7fd9e7c0f920>[number of indexes: 8 (in 4 ranges), indexes: (1-3 5 53 61-63)]
  documentType                             : 1
  physicalSize                             : [width = 21.61 cms, height = 29.70 cms]
  measurementUnit                          : 1
  supportedResolutions                     : <NSMutableIndexSet: 0x7fd9e7e135a0>[number of indexes: 19126 (in 1 ranges), indexes: (75-19200)]
  preferredResolutions                     : <NSMutableIndexSet: 0x7fd9e7e02cc0>[number of indexes: 7 (in 7 ranges), indexes: (75 100 150 200 300 400 600)]
  resolution                               : 300
  overviewResolution                       : 300
  supportedScaleFactors                    : <NSMutableIndexSet: 0x7fd9e7e16020>[number of indexes: 376 (in 1 ranges), indexes: (25-400)]
  preferredScaleFactors                    : <NSMutableIndexSet: 0x7fd9e7e16f10>[number of indexes: 14 (in 14 ranges), indexes: (50 70 78 83 85 91 94 97 100 104 141 200 300 400)]
  scaleFactor                              : 100
  acceptsThresholdForBlackAndWhiteScanning : YES
  usesThresholdForBlackAndWhiteScanning    : NO
  thresholdForBlackAndWhiteScanning        : 127
  templates                                : (null)
  vendorFeatures                           : (
    "ICScannerFeatureEnumeration <0x7fd9e7e19180>:
  type                    : ICScannerFeatureTypeEnumeration
  internalName            : CVF_IMAGE_ADJUSTMENT
  humanReadableName       : Image Adjustment
  tooltip                 : Selects the effect of the function which optimizes the brightness of the image.
  currentValue            : 4
  defaultValue            : 0
  values                  : 0
                            4
                            1
                            3
                            2
  menuItemLabels          : None
                            Auto
                            Photo
                            Magazine
                            Document
  menuItemLabelsTooltips  : 
",
    "ICScannerFeatureEnumeration <0x7fd9e7c0e240>:
  type                    : ICScannerFeatureTypeEnumeration
  internalName            : CVF_REDUCE_DUST
  humanReadableName       : Reduce Dust
  tooltip                 : Selects the effect of the function which reduces white dots caused by dust or scratches on photos.
  currentValue            : 2
  defaultValue            : 0
  values                  : 0
                            1
                            2
                            3
  menuItemLabels          : None
                            Low
                            Medium
                            High
  menuItemLabelsTooltips  : 
",
    "ICScannerFeatureEnumeration <0x7fd9e7c0e3d0>:
  type                    : ICScannerFeatureTypeEnumeration
  internalName            : CVF_FADING_CORRECTION
  humanReadableName       : Fading Correction
  tooltip                 : Selects the effect of the function which corrects photos and film that have faded with time or have a colorcast. This option is effective only when [Color] is selected in [Color Mode] (kind).
  currentValue            : 2
  defaultValue            : 0
  values                  : 0
                            1
                            2
                            3
  menuItemLabels          : None
                            Low
                            Medium
                            High
  menuItemLabelsTooltips  : 
",
    "ICScannerFeatureEnumeration <0x7fd9e7c0e470>:
  type                    : ICScannerFeatureTypeEnumeration
  internalName            : CVF_GRAIN_CORRECTION
  humanReadableName       : Grain Correction
  tooltip                 : Selects the effect of the function which reduces graininess (roughness) in photos taken with high-speed film or at high sensitivity.
  currentValue            : 2
  defaultValue            : 0
  values                  : 0
                            1
                            2
                            3
  menuItemLabels          : None
                            Low
                            Medium
                            High
  menuItemLabelsTooltips  : 
",
    "ICScannerFeatureEnumeration <0x7fd9e7c097a0>:
  type                    : ICScannerFeatureTypeEnumeration
  internalName            : CVF_CUBS
  humanReadableName       : Gutter Correction
  tooltip                 : Selects the effect of the function which corrects shadows that appear between pages when scanning open booklets. When using this correction function, place the original so that it is not slanted. During the scan, press the center of the spine with the same pressure as that applied during the preview scan.
  currentValue            : 2
  defaultValue            : 0
  values                  : 0
                            1
                            2
                            3
  menuItemLabels          : None
                            Low
                            Medium
                            High
  menuItemLabelsTooltips  : 
",
    "ICScannerFeatureBoolean <0x7fd9e7c0e450>:
  type                    : ICScannerFeatureTypeBoolean
  internalName            : CVF_USM
  humanReadableName       : Unsharp Mask
  tooltip                 : Selects ON/OFF of the function which emphasizes the outline of the subjects to sharpen the image. When [Descreen] is ON, moire may remain unless [Unsharp Mask] is set to OFF.
  value                   : NO
",
    "ICScannerFeatureBoolean <0x7fd9e7c0f5a0>:
  type                    : ICScannerFeatureTypeBoolean
  internalName            : CVF_DESCREEN
  humanReadableName       : Descreen
  tooltip                 : Selects ON/OFF of the function which reduces uneven gradation or a stripe pattern (moire) that appears when photos or pictures printed with fine dots are scanned. Moire may remain unless [Unsharp Mask] is set to OFF.
  value                   : YES
",
    "ICScannerFeatureBoolean <0x7fd9e7c0e5d0>:
  type                    : ICScannerFeatureTypeBoolean
  internalName            : CVF_REDUCE_SHOW_THROGHT
  humanReadableName       : Reduce Show-through
  tooltip                 : Selects ON/OFF of the function which reduces show-through in duplex documents or lightens the base color in recycled paper and other colored paper. This option is available only when [Document] or [Magazine] is selected in [Image Adjustment].
  value                   : YES
",
    "ICScannerFeatureBoolean <0x7fd9e7c0f720>:
  type                    : ICScannerFeatureTypeBoolean
  internalName            : CVF_CALIBRATION
  humanReadableName       : Calibrate before each scan
  tooltip                 : Performs calibration before each scan.
  value                   : NO
"
)
  state                                    : 0x00000001
 error: [no error]
didSelectFunctionalUnit: ICScannerFunctionalUnitFlatbed <0x7fd9e7e03870>:
  pixelDataType                            : ICScannerPixelDataTypeRGB
  supportedBitDepths                       : <NSMutableIndexSet: 0x7fd9e7e18bf0>[number of indexes: 3 (in 3 ranges), indexes: (1 8 16)]
  bitDepth                                 : 8
  supportedDocumentTypes                   : <NSMutableIndexSet: 0x7fd9e7c0f920>[number of indexes: 8 (in 4 ranges), indexes: (1-3 5 53 61-63)]
  documentType                             : 1
  physicalSize                             : [width = 21.61 cms, height = 29.70 cms]
  measurementUnit                          : 1
  supportedResolutions                     : <NSMutableIndexSet: 0x7fd9e7e135a0>[number of indexes: 19126 (in 1 ranges), indexes: (75-19200)]
  preferredResolutions                     : <NSMutableIndexSet: 0x7fd9e7e02cc0>[number of indexes: 7 (in 7 ranges), indexes: (75 100 150 200 300 400 600)]
  resolution                               : 300
  overviewResolution                       : 300
  supportedScaleFactors                    : <NSMutableIndexSet: 0x7fd9e7e16020>[number of indexes: 376 (in 1 ranges), indexes: (25-400)]
  preferredScaleFactors                    : <NSMutableIndexSet: 0x7fd9e7e16f10>[number of indexes: 14 (in 14 ranges), indexes: (50 70 78 83 85 91 94 97 100 104 141 200 300 400)]
  scaleFactor                              : 100
  acceptsThresholdForBlackAndWhiteScanning : YES
  usesThresholdForBlackAndWhiteScanning    : NO
  thresholdForBlackAndWhiteScanning        : 127
  templates                                : (null)
  vendorFeatures                           : (
    "ICScannerFeatureEnumeration <0x7fd9e7e19180>:
  type                    : ICScannerFeatureTypeEnumeration
  internalName            : CVF_IMAGE_ADJUSTMENT
  humanReadableName       : Image Adjustment
  tooltip                 : Selects the effect of the function which optimizes the brightness of the image.
  currentValue            : 4
  defaultValue            : 0
  values                  : 0
                            4
                            1
                            3
                            2
  menuItemLabels          : None
                            Auto
                            Photo
                            Magazine
                            Document
  menuItemLabelsTooltips  : 
",
    "ICScannerFeatureEnumeration <0x7fd9e7c0e240>:
  type                    : ICScannerFeatureTypeEnumeration
  internalName            : CVF_REDUCE_DUST
  humanReadableName       : Reduce Dust
  tooltip                 : Selects the effect of the function which reduces white dots caused by dust or scratches on photos.
  currentValue            : 2
  defaultValue            : 0
  values                  : 0
                            1
                            2
                            3
  menuItemLabels          : None
                            Low
                            Medium
                            High
  menuItemLabelsTooltips  : 
",
    "ICScannerFeatureEnumeration <0x7fd9e7c0e3d0>:
  type                    : ICScannerFeatureTypeEnumeration
  internalName            : CVF_FADING_CORRECTION
  humanReadableName       : Fading Correction
  tooltip                 : Selects the effect of the function which corrects photos and film that have faded with time or have a colorcast. This option is effective only when [Color] is selected in [Color Mode] (kind).
  currentValue            : 2
  defaultValue            : 0
  values                  : 0
                            1
                            2
                            3
  menuItemLabels          : None
                            Low
                            Medium
                            High
  menuItemLabelsTooltips  : 
",
    "ICScannerFeatureEnumeration <0x7fd9e7c0e470>:
  type                    : ICScannerFeatureTypeEnumeration
  internalName            : CVF_GRAIN_CORRECTION
  humanReadableName       : Grain Correction
  tooltip                 : Selects the effect of the function which reduces graininess (roughness) in photos taken with high-speed film or at high sensitivity.
  currentValue            : 2
  defaultValue            : 0
  values                  : 0
                            1
                            2
                            3
  menuItemLabels          : None
                            Low
                            Medium
                            High
  menuItemLabelsTooltips  : 
",
    "ICScannerFeatureEnumeration <0x7fd9e7c097a0>:
  type                    : ICScannerFeatureTypeEnumeration
  internalName            : CVF_CUBS
  humanReadableName       : Gutter Correction
  tooltip                 : Selects the effect of the function which corrects shadows that appear between pages when scanning open booklets. When using this correction function, place the original so that it is not slanted. During the scan, press the center of the spine with the same pressure as that applied during the preview scan.
  currentValue            : 2
  defaultValue            : 0
  values                  : 0
                            1
                            2
                            3
  menuItemLabels          : None
                            Low
                            Medium
                            High
  menuItemLabelsTooltips  : 
",
    "ICScannerFeatureBoolean <0x7fd9e7c0e450>:
  type                    : ICScannerFeatureTypeBoolean
  internalName            : CVF_USM
  humanReadableName       : Unsharp Mask
  tooltip                 : Selects ON/OFF of the function which emphasizes the outline of the subjects to sharpen the image. When [Descreen] is ON, moire may remain unless [Unsharp Mask] is set to OFF.
  value                   : NO
",
    "ICScannerFeatureBoolean <0x7fd9e7c0f5a0>:
  type                    : ICScannerFeatureTypeBoolean
  internalName            : CVF_DESCREEN
  humanReadableName       : Descreen
  tooltip                 : Selects ON/OFF of the function which reduces uneven gradation or a stripe pattern (moire) that appears when photos or pictures printed with fine dots are scanned. Moire may remain unless [Unsharp Mask] is set to OFF.
  value                   : YES
",
    "ICScannerFeatureBoolean <0x7fd9e7c0e5d0>:
  type                    : ICScannerFeatureTypeBoolean
  internalName            : CVF_REDUCE_SHOW_THROGHT
  humanReadableName       : Reduce Show-through
  tooltip                 : Selects ON/OFF of the function which reduces show-through in duplex documents or lightens the base color in recycled paper and other colored paper. This option is available only when [Document] or [Magazine] is selected in [Image Adjustment].
  value                   : YES
",
    "ICScannerFeatureBoolean <0x7fd9e7c0f720>:
  type                    : ICScannerFeatureTypeBoolean
  internalName            : CVF_CALIBRATION
  humanReadableName       : Calibrate before each scan
  tooltip                 : Performs calibration before each scan.
  value                   : NO
"
)
  state                                    : 0x00000001
 error: The operation couldn’t be completed. (com.apple.ImageCaptureCore error -9922.)
klep commented 6 years ago

Is the scanner working properly when scanning in Preview? What if you take out the -browsesecs 1 param and also add -flatbed?

oroce commented 5 years ago

For me with Canon MG3600 Series using -flatbad resolves the issue.

klep commented 5 years ago

Good to know. I don't have a scanner without a doc feeder, but I'm guessing that's the issue. If anyone is able to submit a PR to properly handle flatbed-only scanners, I'd appreciate it!

mcfadden commented 5 years ago

Just ran into this with a Brother HL-L3290CDW series all in one as well. The -flatbed option worked perfectly.

joeshaw commented 3 years ago

I am seeing this with an EPSON ES-300W scanner. It's a feeder-only scanner, there's no flatbed.

The app loops forever with:

2020-11-23 18:54:30:437 scanline[17092:307] setting functional unit
2020-11-23 18:54:30:437 scanline[17092:307] current functional unit: 0
2020-11-23 18:54:30:440 scanline[17092:307] doc feeder is 3
2020-11-23 18:54:30:440 scanline[17092:307] flatbed is 0
2020-11-23 18:54:30:440 scanline[17092:307]   selected functionalUnitType: 0

2020-11-23 18:54:30:440 scanline[17092:307]   error:          Error Domain=com.apple.ImageCaptureCore Code=-9922 "(null)"

Same thing whether I use -flatbed or not.

joeshaw commented 3 years ago

Sorry, false alarm. The scanner driver was apparently broken on Catalina. Installing a new driver from Epson fixed things.