From 115d6df94ff48e6dc4f05da5976775b2fc4f3596 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Fri, 12 May 2017 12:09:53 -0700 Subject: [PATCH] =?UTF-8?q?Warn=20user=20when=20=E2=80=94image-dpi=20is=20?= =?UTF-8?q?supplied=20but=20ignored?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ocrmypdf/pipeline.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocrmypdf/pipeline.py b/ocrmypdf/pipeline.py index 507a9f9a..b95e76f1 100644 --- a/ocrmypdf/pipeline.py +++ b/ocrmypdf/pipeline.py @@ -159,17 +159,20 @@ def triage( log, context): + options = context.get_options() try: with open(input_file, 'rb') as f: signature = f.read(4) if signature == b'%PDF': + if options.image_dpi: + log.warning("Argument --image-dpi ignored because the " + "input file is a PDF, not an image.") re_symlink(input_file, output_file, log) return except EnvironmentError as e: log.error(e) raise InputFileError() from e - options = context.get_options() triage_image_file(input_file, output_file, log, options)