Source: ghostscript, ocrmypdf
Control: found -1 ghostscript/9.25~dfsg-2
Control: found -1 ocrmypdf/6.2.3-1
X-Debbugs-CC: debian...@lists.debian.org
User: debian...@lists.debian.org
Usertags: breaks needs-update
Dear maintainers,
With a recent upload of ghostscript the autopkgtest of ocrmypdf fails in
testing when that autopkgtest is run with the binary packages of
ghostscript from unstable. It passes when run with only packages from
testing. I copied some of the output at the bottom of this report.
As ghostscript is uploaded with urgency high, this regression is NOT
delaying of the migration of ghostscript to testing [1]. If this
regression requires blockage of ghostscript to testing, fast action is
required (raising the severity of this bug should be enough, albeit I
haven't tested RC blockage when bugs are assigned to multiple packages.
Due to the nature of this issue, I filed this bug report against both
packages. Can you please investigate the situation and reassign the bug
to the right package? As needed, please change the bug's severity.
More information about this bug and the reason for filing it can be found on
https://wiki.debian.org/ContinuousIntegration/RegressionEmailInformation
Paul
[1] https://qa.debian.org/excuses.php?package=ghostscript
https://ci.debian.net/data/autopkgtest/testing/amd64/o/ocrmypdf/1000885/log.gz
=== FAILURES
===
___ test_compression_changed[congress.jpg-lossless]
spoof_tesseract_noop = {'ADTTMP':
'/tmp/autopkgtest-lxc.bj5c8t8i/downtmp/autopkgtest_tmp',
'ADT_ARTIFACTS':
'/tmp/autopkgtest-lxc.bj5c8t8i/do...j5c8t8i/downtmp/test-suite-artifacts',
'AUTOPKGTEST_TMP':
'/tmp/autopkgtest-lxc.bj5c8t8i/downtmp/autopkgtest_tmp', ...}
ocrmypdf_exec = ['/usr/bin/python3', '-m', 'ocrmypdf']
resources =
PosixPath('/tmp/autopkgtest-lxc.bj5c8t8i/downtmp/build.24A/src/tests/resources')
image = 'congress.jpg', compression = 'lossless'
outpdf =
'/tmp/pytest-of-debci/pytest-0/test_compression_changed_congr0/out.pdf'
@pytest.mark.parametrize('image,compression', [
('baiona.png', 'jpeg'),
('baiona_gray.png', 'lossless'),
('congress.jpg', 'lossless')
])
def test_compression_changed(spoof_tesseract_noop, ocrmypdf_exec,
resources, image, compression, outpdf):
from PIL import Image
input_file = str(resources / image)
output_file = str(outpdf)
im = Image.open(input_file)
# Runs: ocrmypdf - output.pdf < testfile
with open(input_file, 'rb') as input_stream:
p_args = ocrmypdf_exec + [
'--image-dpi', '150', '--output-type', 'pdfa',
'--pdfa-image-compression', compression,
'-', output_file]
p = Popen(
p_args, close_fds=True, stdout=PIPE, stderr=PIPE,
stdin=input_stream, env=spoof_tesseract_noop)
out, err = p.communicate()
assert p.returncode == ExitCode.ok, err
pdfinfo = PdfInfo(output_file)
pdfimage = pdfinfo[0].images[0]
if compression == "jpeg":
assert pdfimage.enc == Encoding.jpeg
else:
if ghostscript.jpeg_passthrough_available():
# Ghostscript 9.23 adds JPEG passthrough, which allows a
JPEG to be
# copied without transcoding - so report
if image.endswith('jpg'):
assert pdfimage.enc == Encoding.jpeg
else:
> assert pdfimage.enc not in (Encoding.jpeg,
Encoding.jpeg2000)
E AssertionError: assert not in
(, )
E+ where = .enc
tests/test_main.py:917: AssertionError
_ test_preserve_metadata[pdfa]
_
spoof_tesseract_noop = {'ADTTMP':
'/tmp/autopkgtest-lxc.bj5c8t8i/downtmp/autopkgtest_tmp',
'ADT_ARTIFACTS':
'/tmp/autopkgtest-lxc.bj5c8t8i/do...j5c8t8i/downtmp/test-suite-artifacts',
'AUTOPKGTEST_TMP':
'/tmp/autopkgtest-lxc.bj5c8t8i/downtmp/autopkgtest_tmp', ...}
output_type = 'pdfa'
resources =
PosixPath('/tmp/autopkgtest-lxc.bj5c8t8i/downtmp/build.24A/src/tests/resources')
outpdf =
'/tmp/pytest-of-debci/pytest-0/test_preserve_metadata_pdfa_0/out.pdf'
@pytest.mark.parametrize("output_type", [
'pdfa', 'pdf'
])
def test_preserve_metadata(spoof_tesseract_noop, output_type,
resources, outpdf):
pdf_before = pypdf.PdfFileReader(str(resources / 'graph.pdf'))
output = check_ocrmypdf(
resources / 'graph.pdf', outpdf,
'--output-type', output_type,
env=spoof_tesseract_noop)
pdf_after = pypdf.PdfFileReader(str(output))
for key in ('/Title', '/Author'):
> assert pdf_before.documentInfo[key] ==
pdf_after.documentInfo[key]
tests/test_metadata.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _