From 383e726d65fc17e5173efc2da576a279ff957fee Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Fri, 27 Apr 2018 19:34:57 -0700 Subject: [PATCH] Expand size growth reasons to other arguments that trigger transcoding --- src/ocrmypdf/__main__.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/ocrmypdf/__main__.py b/src/ocrmypdf/__main__.py index 2d0a0a0c..55bf6644 100755 --- a/src/ocrmypdf/__main__.py +++ b/src/ocrmypdf/__main__.py @@ -787,8 +787,20 @@ def report_output_file_size(options, _log, input_file, output_file): reasons = [] if not fitz: reasons.append("The optional dependency PyMuPDF is not installed.") - if options.force_ocr: - reasons.append("The argument --force-ocr was issued.") + image_preproc = { + 'deskew', + 'clean_final', + 'remove_background', + 'oversample', + 'force_ocr' + } + for arg in image_preproc: + attr = getattr(options, arg, None) + if not attr: + continue + reasons.append( + "The argument --{} was issued, causing transcoding.".format( + arg.replace('_', '-'))) if reasons: explanation = (