Suggestions from review

This commit is contained in:
Trenton H 2024-03-04 09:39:42 -08:00
parent eb748ee6c2
commit 26e95ea117
2 changed files with 6 additions and 2 deletions

View File

@ -777,7 +777,7 @@ but could result in missing text content.
!!! warning
The limit is intended to prevent malicious files from consuming
system resources and causing crashes and other errors. Only increase
system resources and causing crashes and other errors. Only change
this value if you are certain your documents are not malicious and
you need the text which was not OCRed

View File

@ -299,7 +299,11 @@ class RasterisedDocumentParser(DocumentParser):
):
# Convert pixels to mega-pixels and provide to ocrmypdf
max_pixels_mpixels = self.settings.max_image_pixel / 1_000_000.0
self.log.debug(f"Calculated {max_pixels_mpixels} megapixels for OCR")
if max_pixels_mpixels == 0:
msg = "OCR pixel limit is disabled!"
else:
msg = f"Calculated {max_pixels_mpixels} megapixels for OCR"
self.log.debug(msg)
ocrmypdf_args["max_image_mpixels"] = max_pixels_mpixels
return ocrmypdf_args