Ensure --image-dpi on non-image produces a warning

This commit is contained in:
James R. Barlow
2019-08-09 01:08:16 -07:00
parent a6805ed343
commit 77bbc22c50
2 changed files with 12 additions and 1 deletions
+1 -1
View File
@@ -129,7 +129,7 @@ def triage(input_file, output_file, options, log):
if _pdf_guess_version(input_file):
if options.image_dpi:
log.warning(
"Argument --image-dpi ignored because the "
"Argument --image-dpi is being ignored because the "
"input file is a PDF, not an image."
)
# Origin file is a pdf create a symlink with pdf extension
+11
View File
@@ -1125,3 +1125,14 @@ def test_fast_web_view(
)
with pikepdf.open(outpdf) as pdf:
assert pdf.is_linearized == expected
def test_image_dpi_not_image(caplog, spoof_tesseract_noop, resources, outpdf):
check_ocrmypdf(
resources / 'trivial.pdf',
outpdf,
'--image-dpi',
'100',
env=spoof_tesseract_noop,
)
assert '--image-dpi is being ignored' in caplog.text