pdf: ocr function was broken for python3 in some cases (depending on how the ocr language was specified)

This commit is contained in:
Jean-Francois Dockes 2019-06-13 08:33:55 +02:00
parent 4c205e44e0
commit 9dcdb6e9a6

View File

@ -243,7 +243,7 @@ class PDFExtractor:
tesseractlang = os.environ.get("RECOLL_TESSERACT_LANG", ""); tesseractlang = os.environ.get("RECOLL_TESSERACT_LANG", "");
if tesseractlang: if tesseractlang:
return tesseractlang return tesseractlang
pdflangfile = os.path.join(self.confdir, b"ocrpdf") pdflangfile = os.path.join(self.confdir, "ocrpdf")
if os.path.isfile(pdflangfile): if os.path.isfile(pdflangfile):
tesseractlang = open(pdflangfile, "r").read().strip() tesseractlang = open(pdflangfile, "r").read().strip()
if tesseractlang: if tesseractlang: