From 7580afa6bc1459c85717f314dcd9e93110a986ab Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Wed, 29 Nov 2023 08:28:52 -0800 Subject: [PATCH] Add a warning about a low image DPI which may cause OCR to fail --- src/paperless_tesseract/parsers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/paperless_tesseract/parsers.py b/src/paperless_tesseract/parsers.py index f64ea8adf..f80a119cc 100644 --- a/src/paperless_tesseract/parsers.py +++ b/src/paperless_tesseract/parsers.py @@ -244,6 +244,10 @@ class RasterisedDocumentParser(DocumentParser): f"no DPI information is present in this image and " f"OCR_IMAGE_DPI is not set.", ) + if ocrmypdf_args["image_dpi"] < 70: # pragma: nocover + self.log.warning( + f"Image DPI of {ocrmypdf_args['image_dpi']} is low, OCR may fail", + ) if settings.OCR_USER_ARGS and not safe_fallback: try: