Ghostscript: disable JPEG passthrough for ocrmypdf v6.x

This feature works for gs >= 9.24, but we don't want to change behavior in
a backport, so we're disabling it unconditionally.
This commit is contained in:
James R. Barlow
2018-09-16 14:56:50 -07:00
parent e38b30af1c
commit 6b5934ff4e
2 changed files with 25 additions and 22 deletions
+1 -7
View File
@@ -908,13 +908,7 @@ def test_compression_changed(spoof_tesseract_noop, ocrmypdf_exec,
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)
assert pdfimage.enc not in (Encoding.jpeg, Encoding.jpeg2000)
if im.mode.startswith('RGB') or im.mode.startswith('BGR'):
assert pdfimage.color == Colorspace.rgb, \