check that OCR_LANGUAGE has also been set

This commit is contained in:
deeplow 2022-08-22 11:55:21 +01:00
parent 463ff97b97
commit 23e30ae40a
No known key found for this signature in database
GPG key ID: 577982871529A52A

View file

@ -334,7 +334,7 @@ class DangerzoneConverter:
with open(height_filename) as f:
height = f.read().strip()
if os.environ.get("OCR") == "1":
if os.environ.get("OCR") == "1" and os.environ.get("OCR_LANGUAGE"):
# OCR the document
self.output(
False,
@ -379,7 +379,7 @@ class DangerzoneConverter:
png_filename,
ocr_filename,
"-l",
os.environ.get("OCR_LANGUAGE"),
os.environ.get("OCR_LANGUAGE"), # type: ignore
"--dpi",
"70",
"pdf",