Ensure --image-dpi on non-image produces a warning
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user