From 92a920021d1c67a16024fa777f9e53a83845e67a Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Thu, 14 Dec 2023 11:20:47 -0800 Subject: [PATCH] Apply user arguments even in the case of the safe fallback to forcing OCR (#4981) --- docs/configuration.md | 2 +- src/paperless_tesseract/parsers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index 87d992443..b2e479f98 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -733,7 +733,7 @@ they use underscores instead of dashes. Paperless has been tested to work with the OCR options provided above. There are many options that are incompatible with each other, so specifying invalid options may prevent paperless from consuming - any documents. + any documents. Use with caution! Specify arguments as a JSON dictionary. Keep note of lower case booleans and double quoted parameter names and strings. Examples: diff --git a/src/paperless_tesseract/parsers.py b/src/paperless_tesseract/parsers.py index babcf6bcf..46d106bd7 100644 --- a/src/paperless_tesseract/parsers.py +++ b/src/paperless_tesseract/parsers.py @@ -254,7 +254,7 @@ class RasterisedDocumentParser(DocumentParser): f"Image DPI of {ocrmypdf_args['image_dpi']} is low, OCR may fail", ) - if settings.OCR_USER_ARGS and not safe_fallback: + if settings.OCR_USER_ARGS: try: user_args = json.loads(settings.OCR_USER_ARGS) ocrmypdf_args = {**ocrmypdf_args, **user_args}