sane-scan-pdf icon indicating copy to clipboard operation
sane-scan-pdf copied to clipboard

no decode delegate for this image format

Open rajil opened this issue 2 years ago • 3 comments

Any idea why the script is failing on the Brother DCP-L2541 printer. I have imagemagick 7.1.0.25-1 installed on the Arch system.

$ ./scan -x "brother4:net1;dev0"  -r 300 -v --mode-hw-default  --no-default-size --ocr --unpaper  -a -o /tmp/a.pdf
Scanning...
scanadf: rounded value of br-x from 211.9 to 211.881
scanadf: rounded value of br-y from 355.6 to 355.567
Scanned document /tmp/scan.PgVN9BfQhp/scan-0001
scan_perpage: 
scan_perpage: -------------------------------------------------------------------------------
scan_perpage: Post-processing scanned page /tmp/scan.PgVN9BfQhp/scan-0001, deskew=1, searchable=1, skip-empty-pages=0, white-threshold=99.8, brightness-contrast-sw=...
scan_perpage: -------------------------------------------------------------------------------
scan_perpage: Applying unpaper post-processing to image data...
unpaper 6.1
License GPLv2: GNU GPL version 2.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

-------------------------------------------------------------------------------
Processing sheet #1: /tmp/scan.PgVN9BfQhp/scan-0001 -> /tmp/scan.PgVN9BfQhp/unpaper-scan-0001
input-file for sheet 1: /tmp/scan.PgVN9BfQhp/scan-0001
output-file for sheet 1: /tmp/scan.PgVN9BfQhp/unpaper-scan-0001
sheet size: 2480x4175
...
noise-filter ... deleted 879 clusters.
blur-filter... deleted 903 pixels.
auto-masking (1240,2087): 875,0,1970,4174
gray-filter... deleted 44871600 pixels.
auto-masking (1240,2087): 875,0,1970,4174
detected rotation left: [875,0,1970,4174]: 0.003491
detected rotation right: [875,0,1970,4174]: 0.003491
rotation average: 0.003491  deviation: 0.000000  rotation-scan-deviation (maximum): 0.017453  [875,0,1970,4174]
rotate (1240,2087): 0.003491
auto-masking (1240,2087): 875,0,1965,4174
centering mask [875,0,1965,4174] (1240,2087): -180, 0
border detected: (0,85,1,1181) in [0,0,2479,4174]
aligning mask [0,85,2478,2993] (0,632): 0, 547
writing output.

real    0m4.642s
user    0m4.529s
sys     0m0.110s
scan_perpage: Converting image data to searchable pdf...
scan_perpage: ...Running convert
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/737.
convert: no images defined `/tmp/scan.PgVN9BfQhp/unpaper-scan-0001.tiff' @ error/convert.c/ConvertImageCommand/3325.

real    0m0.025s
user    0m0.006s
sys     0m0.003s
scan_perpage: ...Running tesseract
Error, cannot read input file /tmp/scan.PgVN9BfQhp/unpaper-scan-0001.tiff: No such file or directory
Error during processing.

real    0m0.207s
user    0m0.122s
sys     0m0.033s
scan_perpage: 
scan_perpage: Scan page processing done, status = 1
Scanned document /tmp/scan.PgVN9BfQhp/scan-0002
Scanned 2 pages
scan_perpage: 
scan_perpage: -------------------------------------------------------------------------------
scan_perpage: Post-processing scanned page /tmp/scan.PgVN9BfQhp/scan-0002, deskew=1, searchable=1, skip-empty-pages=0, white-threshold=99.8, brightness-contrast-sw=...
scan_perpage: -------------------------------------------------------------------------------
scan_perpage: Applying unpaper post-processing to image data...
unpaper 6.1
License GPLv2: GNU GPL version 2.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

-------------------------------------------------------------------------------
Processing sheet #1: /tmp/scan.PgVN9BfQhp/scan-0002 -> /tmp/scan.PgVN9BfQhp/unpaper-scan-0002
input-file for sheet 1: /tmp/scan.PgVN9BfQhp/scan-0002
output-file for sheet 1: /tmp/scan.PgVN9BfQhp/unpaper-scan-0002
sheet size: 2480x4175
...
noise-filter ... deleted 217 clusters.
blur-filter... deleted 10 pixels.
auto-masking (1240,2087): 285,0,1940,4174
gray-filter... deleted 45649100 pixels.
auto-masking (1240,2087): 285,0,1935,4174
detected rotation left: [285,0,1935,4174]: 0.010472
detected rotation right: [285,0,1935,4174]: -0.033161
rotation average: -0.011345  deviation: 0.030853  rotation-scan-deviation (maximum): 0.017453  [285,0,1935,4174]
out of deviation range - NO ROTATING
rotate (1240,2087): 0.000000
auto-masking (1240,2087): 285,0,1935,4174
centering mask [285,0,1935,4174] (1240,2087): 130, 0
border detected: (0,75,1,1181) in [0,0,2479,4174]
aligning mask [0,75,2478,2993] (0,627): 0, 552
writing output.

real    0m3.907s
user    0m3.846s
sys     0m0.050s
scan_perpage: Converting image data to searchable pdf...
scan_perpage: ...Running convert
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/737.
convert: no images defined `/tmp/scan.PgVN9BfQhp/unpaper-scan-0002.tiff' @ error/convert.c/ConvertImageCommand/3325.

real    0m0.005s
user    0m0.005s
sys     0m0.000s
scan_perpage: ...Running tesseract
Error, cannot read input file /tmp/scan.PgVN9BfQhp/unpaper-scan-0002.tiff: No such file or directory
Error during processing.

real    0m0.127s
user    0m0.088s
sys     0m0.039s
scan_perpage: 
scan_perpage: Scan page processing done, status = 1
Processing 2 pages
Concatenating pdfs...
Syntax Error: Document stream is empty
Syntax Error: Could not merge damaged documents ('/tmp/scan.PgVN9BfQhp/scan-0001.pdf')

Done.

rajil avatar Mar 01 '22 05:03 rajil

What does identify -list format | grep -i tiff output on your system?

Do you have another scanner you can test with?

rocketraman avatar Mar 01 '22 05:03 rocketraman

$ identify -list format|grep -i tiff
      EPT  EPT       rw-   Encapsulated PostScript with TIFF preview
     EPT2  EPT       rw-   Encapsulated PostScript Level II with TIFF preview
     EPT3  EPT       rw+   Encapsulated PostScript Level III with TIFF preview
   GROUP4* TIFF      rw-   Raw CCITT Group4
     PTIF* TIFF      rw+   Pyramid encoded TIFF
     TIFF* TIFF      rw+   Tagged Image File Format (LIBTIFF, Version 4.3.0)
   TIFF64* TIFF      rw+   Tagged Image File Format (64-bit) (LIBTIFF, Version 4.3.0)

rajil avatar Mar 01 '22 05:03 rajil

Can you try it without --ocr and without --unpaper?

rocketraman avatar Apr 02 '22 04:04 rocketraman

Need more information here, closing for now. Feel free to re-open if you want to continue debugging.

rocketraman avatar Oct 09 '22 22:10 rocketraman