Apply user arguments even in the case of the safe fallback to forcing OCR

This commit is contained in:
Trenton H 2023-12-14 10:04:36 -08:00
parent 72000cac36
commit 812bcd0ed8
2 changed files with 2 additions and 2 deletions

View File

@ -733,7 +733,7 @@ they use underscores instead of dashes.
Paperless has been tested to work with the OCR options provided Paperless has been tested to work with the OCR options provided
above. There are many options that are incompatible with each other, above. There are many options that are incompatible with each other,
so specifying invalid options may prevent paperless from consuming 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 Specify arguments as a JSON dictionary. Keep note of lower case
booleans and double quoted parameter names and strings. Examples: booleans and double quoted parameter names and strings. Examples:

View File

@ -254,7 +254,7 @@ class RasterisedDocumentParser(DocumentParser):
f"Image DPI of {ocrmypdf_args['image_dpi']} is low, OCR may fail", 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: try:
user_args = json.loads(settings.OCR_USER_ARGS) user_args = json.loads(settings.OCR_USER_ARGS)
ocrmypdf_args = {**ocrmypdf_args, **user_args} ocrmypdf_args = {**ocrmypdf_args, **user_args}