This is almost certainly a problem with how Debian is compiling or linking
ghostscript with libjbig2dec. This error would be reproducible with:

gs -sDEVICE=pngmono -o out.png any_pdf_that_contains_a_jbig2_image.pdf

Debian's test suite for ghostscript is just a simple smoke test, so
ocrmypdf frequently uncovers problems with ghostscript.

James

On Sun, Nov 29, 2020 at 7:42 AM Matthias Klose <d...@debian.org> wrote:

> Package: src:ocrmypdf
> Version: 10.3.1+dfsg-1
> Severity: serious
> Tags: sid bullseye
>
> ocrmypd fails autopkg tests in testing, but not in unstable. Looks like a
> missing break on some dependency?
>
> see https://ci.debian.net/packages/o/ocrmypdf
>
> [...]
> resources =
>
> PosixPath('/tmp/autopkgtest-lxc.fy1hic18/downtmp/build.Qgv/src/tests/resources')
> outdir =
> PosixPath('/tmp/pytest-of-debci/pytest-0/test_rotate_deskew_timeout0')
>
>     def test_rotate_deskew_timeout(resources, outdir):
>         check_ocrmypdf(
>             resources / 'rotated_skew.pdf',
>             outdir / 'deskewed.pdf',
>             '--rotate-pages',
>             '--rotate-pages-threshold',
>             '0',
>             '--deskew',
>             '--tesseract-timeout',
>             '0',
>             '--pdf-renderer',
>             'sandwich',
>         )
>
>         correlation = check_monochrome_correlation(
>             outdir,
>             reference_pdf=resources / 'ccitt.pdf',
>             reference_pageno=1,
>             test_pdf=outdir / 'deskewed.pdf',
>             test_pageno=1,
>         )
>
>         # Confirm that the page still got deskewed
> >       assert correlation > 0.50
> E       assert 0.0 > 0.5
>
> tests/test_rotation.py:214: AssertionError
> ----------------------------- Captured stderr call
> -----------------------------
>
> Scanning contents:   0%|          | 0/1 [00:00<?, ?page/s]
> Scanning contents: 100%|██████████| 1/1 [00:00<00:00, 256.25page/s]
>
> OCR:   0%|          | 0.0/1.0 [00:00<?, ?page/s]
> OCR:  50%|█████     | 0.5/1.0 [00:00<00:00,  1.62page/s]
> OCR: 100%|██████████| 1.0/1.0 [00:00<00:00,  3.19page/s]
>
> JPEGs: 0image [00:00, ?image/s]
> JPEGs: 0image [00:00, ?image/s]
>
> JBIG2: 0item [00:00, ?item/s]
> JBIG2: 0item [00:00, ?item/s]
> ------------------------------ Captured log call
> -------------------------------
> INFO     ocrmypdf.builtin_plugins.tesseract_ocr:tesseract_ocr.py:136 Using
> Tesseract OpenMP thread limit 2
> ERROR    ocrmypdf._exec.ghostscript:ghostscript.py:134 jbig2dec FATAL ERROR
> decoding image: incompatible jbig2dec header (0.18) and library (0.19)
> versions
>                                                           **** Error
> reading a
> content stream. The page may be incomplete.
>
> Output may
> be incorrect.
>                                                           **** Error: File
> did
> not complete the page properly and may be damaged.
>
> Output may
> be incorrect.
> INFO     ocrmypdf._pipeline:_pipeline.py:401 with existing rotation ⇨,
> page is
> facing ⇧, confidence 0.00 - rotation appears correct
> ERROR    ocrmypdf._exec.ghostscript:ghostscript.py:134 jbig2dec FATAL ERROR
> decoding image: incompatible jbig2dec header (0.18) and library (0.19)
> versions
>                                                           **** Error
> reading a
> content stream. The page may be incomplete.
>
> Output may
> be incorrect.
>                                                           **** Error: File
> did
> not complete the page properly and may be damaged.
>
> Output may
> be incorrect.
> WARNING  ocrmypdf._pipeline:_pipeline.py:738 Some input metadata could not
> be
> copied because it is not permitted in PDF/A. You may wish to examine the
> output
> PDF's XMP metadata.
> INFO     ocrmypdf.optimize:optimize.py:589 Optimize ratio: 1.00 savings:
> 0.0%
> INFO     ocrmypdf._sync:_sync.py:381 Output file is a PDF/A-2B (as
> expected)
> ======== 4 failed, 240 passed, 37 skipped, 1 xfailed in 359.28 seconds
> =========
> autopkgtest [08:20:25]: test test-suite: -----------------------]
> autopkgtest [08:20:25]: test test-suite:  - - - - - - - - - - results - -
> - - - - -
>
>

Reply via email to