Refactor 'xyres' into Resolution

This commit is contained in:
James R. Barlow
2020-04-24 04:12:05 -07:00
parent 57771f06a3
commit 94c52a6fa3
10 changed files with 153 additions and 104 deletions
+5 -1
View File
@@ -26,6 +26,7 @@ from PIL import Image
from ocrmypdf import optimize as opt
from ocrmypdf.exec import jbig2enc, pngquant
from ocrmypdf.exec.ghostscript import rasterize_pdf
from ocrmypdf.helpers import Resolution
check_ocrmypdf = pytest.helpers.check_ocrmypdf # pylint: disable=e1101
@@ -43,7 +44,10 @@ def test_mono_not_inverted(resources, outdir):
opt.main(infile, outdir / 'out.pdf', level=3)
rasterize_pdf(
outdir / 'out.pdf', outdir / 'im.png', raster_device='pnggray', xyres=(10, 10)
outdir / 'out.pdf',
outdir / 'im.png',
raster_device='pnggray',
raster_dpi=Resolution(10, 10),
)
with Image.open(fspath(outdir / 'im.png')) as im: