Use better img2pdf settings where possible while supporting old versions

Fixes #894
This commit is contained in:
James R. Barlow
2022-01-14 11:55:54 -08:00
parent 7d208175cf
commit 2d0ac4707c
6 changed files with 23 additions and 11 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ from PIL import Image, ImageDraw
from ocrmypdf import optimize as opt
from ocrmypdf._exec import jbig2enc, pngquant
from ocrmypdf._exec.ghostscript import rasterize_pdf
from ocrmypdf.helpers import Resolution
from ocrmypdf.helpers import IMG2PDF_KWARGS, Resolution
from .conftest import check_ocrmypdf
@@ -139,8 +139,8 @@ def test_multiple_pngs(resources, outdir):
img2pdf.convert(
fspath(resources / 'baiona_colormapped.png'),
fspath(resources / 'baiona_gray.png'),
with_pdfrw=False,
outputstream=inpdf,
**IMG2PDF_KWARGS,
)
def mockquant(input_file, output_file, *_args):