klep / scanline

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

Scanline throws CoreGraphics PDF error #42

Open aixakt opened 1 year ago

aixakt commented 1 year ago

Hi,

on MacOS Ventura scanline throws CoreGraphics PDF error, regarding image orientation.

Best regards Ralph

scanline_coregraphiccs_error
klep commented 1 year ago

Thanks for reporting the issue. I don't have a machine running Ventura currently, but if you can set that variable, I'd love to see what it says:

CG_PDF_VERBOSE=1 scanline -v

aixakt commented 1 year ago

Hi Scott,

here is the output you are asking for (with export CG_PDF_VERBOSE=1):

~ ❯ scanline -v Browsing for scanners. Waiting up to 10.0 seconds to find scanners Added device: { UUIDString = "993673E6-DCE6-56FD-406E-BB14BB041DA2"; autolaunchApplicationPath = ""; class = ICScannerDevice; connectionID = 0x00000000; delegate = "<0x0>"; deviceID = 0x00000000; deviceRef = 0x10000015; iconPath = "(null)"; locationDescription = 7403B1; moduleExecutableArchitecture = 0; modulePath = "/System/Library/Image Capture/Devices/AirScanScanner.app"; moduleVersion = "1.0"; name = "HP Color LaserJet Pro M478f-9f [7403B1]"; persistentIDString = "993673E6-DCE6-56FD-406E-BB14BB041DA2"; shared = NO; softwareInstallPercentDone = "0.000000"; transportType = ICTransportTypeTCPIP; type = 0x00000402; } availableFunctionalUnitTypes : selectedFunctionalUnit : (null) <0x0> transferMode : ICScannerTransferModeFileBased downloadsDirectory : file:///Users/ralph/Pictures/ documentName : Scan documentUTI : public.tiff

Done searching for scanners Found scanner: HP Color LaserJet Pro M478f-9f [7403B1] Opening session with scanner didOpenSessionWithError: [no error] deviceDidBecomeReady didSelectFunctionalUnit: error: [no error] didSelectFunctionalUnit: ICScannerFunctionalUnitDocumentFeeder <0x600000a84e60>: supportedBitDepths : <NSMutableIndexSet: 0x600000a84ca0>[number of indexes: 2 (in 2 ranges), indexes: (1 8)] bitDepth : 1 supportedDocumentTypes : <NSMutableIndexSet: 0x600000a85be0>[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 : 1 measurementUnit : 1 supportedResolutions : <NSMutableIndexSet: 0x600000a84c60>[number of indexes: 5 (in 5 ranges), indexes: (75 100 150 200 300)] preferredResolutions : <NSMutableIndexSet: 0x600000a84c60>[number of indexes: 5 (in 5 ranges), indexes: (75 100 150 200 300)] resolution : 200 supportedScaleFactors : <NSMutableIndexSet: 0x600000a84c40>[number of indexes: 1 (in 1 ranges), indexes: (100)] preferredScaleFactors : <NSMutableIndexSet: 0x600000a84c40>[number of indexes: 1 (in 1 ranges), indexes: (100)] scaleFactor : 100 supportsDuplexScanning : YES duplexScanningEnabled : NO vendorFeatures : ( "ICScannerFeatureBoolean <0x600000a84ba0>:\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... didScanTo file:///var/folders/70/x9ymdqwd2gd1lz8z2rgmh9dc0000gn/T/Scan%203.jpeg didCompleteScanWithError [no error] Invalid image orientation, assuming 1. Output path: /Users/ralph/Documents/Archive About to copy file:///var/folders/70/x9ymdqwd2gd1lz8z2rgmh9dc0000gn/T//scan.pdf to /Users/ralph/Documents/Archive/scan_110413.pdf Done

~ took 6s ❯

Best regards Ralph

Am 22.07.2022 um 16:31 schrieb Scott J. Kleper @.***>:

Thanks for reporting the issue. I don't have a machine running Ventura currently, but if you can set that variable, I'd love to see what it says:

CG_PDF_VERBOSE=1 scanline -v

— Reply to this email directly, view it on GitHub https://github.com/klep/scanline/issues/42#issuecomment-1192635859, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABG4XDRPQ74GM3HR33CV7WTVVKWFNANCNFSM53AIC33A. You are receiving this because you authored the thread.

klep commented 1 year ago

Hi Ralph,

I do see that message on Ventura Betas as well, though it doesn't appear to actually cause any issues. Are you experiencing any problems as a result? I did try to find a way around it, but it appears that the scanner is creating a JPEG without orientation information and PDFPage doesn't like that. Changing the underlying format to TIFF makes the message go away, but increases the file size. There may be a way to provide the metadata that PDFPage is expecting, but I don't see any documentation on what that is. Some trial-and-error came up empty.

For now, if it's not causing any problems, let's wait and see if it's still an issue in the Ventura RC.