def test_mono_not_inverted(resources, outdir): infile = resources / '2400dpi.pdf' opt.main(infile, outdir / 'out.pdf', level=3) rasterize_pdf( outdir / 'out.pdf', outdir / 'im.png', raster_device='pnggray', raster_dpi=Resolution(10, 10), ) with Image.open(fspath(outdir / 'im.png')) as im: assert im.getpixel((0, 0)) == 255, "Expected white background"
def test_mono_not_inverted(resources, outdir): infile = resources / '2400dpi.pdf' opt.main(infile, outdir / 'out.pdf', level=3) rasterize_pdf(outdir / 'out.pdf', outdir / 'im.png', xres=10, yres=10, raster_device='pnggray', log=logging.getLogger(name='test_mono_flip')) im = Image.open(fspath(outdir / 'im.png')) assert im.getpixel((0, 0)) == 255, "Expected white background"
def test_mono_not_inverted(resources, outdir): infile = resources / '2400dpi.pdf' opt.main(infile, outdir / 'out.pdf', level=3) rasterize_pdf( outdir / 'out.pdf', outdir / 'im.png', xres=10, yres=10, raster_device='pnggray', log=logging.getLogger(name='test_mono_flip'), ) im = Image.open(fspath(outdir / 'im.png')) assert im.getpixel((0, 0)) == 255, "Expected white background"
def test_basic(resources, pdf, outpdf): infile = resources / pdf opt.main(infile, outpdf, level=3) assert 0.98 * Path(outpdf).stat().st_size <= Path(infile).stat().st_size
def test_basic(resources, pdf, outpdf): infile = resources / pdf opt.main(infile, outpdf, level=3) assert Path(outpdf).stat().st_size <= Path(infile).stat().st_size