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

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