Fix the coverage by being tricky

This commit is contained in:
Trenton H 2024-03-04 09:56:29 -08:00
parent 26e95ea117
commit 22910c2c78

View File

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