Add a warning about a low image DPI which may cause OCR to fail

This commit is contained in:
Trenton H 2023-11-29 08:28:52 -08:00
parent 0913c7aa9e
commit 7580afa6bc

View File

@ -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: