For —rotate-pages, rasterize preview at half DPI instead of 200 DPI
Ensures that time is not wasted on previews at higher resolution than the input as was sometimes the case
This commit is contained in:
@@ -333,13 +333,14 @@ def rasterize_preview(
|
||||
output_file,
|
||||
log,
|
||||
context):
|
||||
pageinfo = get_pageinfo(input_file, context)
|
||||
options = context.get_options()
|
||||
canvas_dpi = get_canvas_square_dpi(pageinfo, options) / 2
|
||||
page_dpi = get_page_square_dpi(pageinfo, options) / 2
|
||||
|
||||
ghostscript.rasterize_pdf(
|
||||
input_file=input_file,
|
||||
output_file=output_file,
|
||||
xres=200,
|
||||
yres=200,
|
||||
raster_device='jpeggray',
|
||||
log=log)
|
||||
input_file, output_file, xres=canvas_dpi, yres=canvas_dpi,
|
||||
raster_device='jpeggray', log=log, page_dpi=(page_dpi, page_dpi))
|
||||
|
||||
|
||||
def orient_page(
|
||||
|
||||
@@ -38,3 +38,8 @@ def test_userunit_qpdf_passes(spoof_tesseract_cache, poster, outpdf):
|
||||
after = PdfInfo(outpdf)
|
||||
assert isclose(before[0].width_inches, after[0].width_inches)
|
||||
|
||||
|
||||
def test_rotate_interaction(spoof_tesseract_cache, poster, outpdf):
|
||||
check_ocrmypdf(poster, outpdf, '--output-type=pdf',
|
||||
'--rotate-pages',
|
||||
env=spoof_tesseract_cache)
|
||||
|
||||
Reference in New Issue
Block a user