Skip to content

Fix crash when initializing OCR if English data is missing

John Doe requested to merge vicsanrope/skanpage:ocrFix into master

Tesseract doesn't need the language for first initialization (to get the list of languages). Since 5.0, changed here. Before it just set the language back to "eng".

The desired language is already passed to Tesseract when it is initialized again for OCR.

Passing "eng" made the initialization fail (if english data is not installed) and skip reading the list of languages. This fixes that.

Also disable the OCR checkbox if there are no installed languages. (I can't test this beyond simulating it in code because Arch Linux makes me install at least one language with Tesseract, (and the default one is the first in alphabetical order, i.e. not "eng"))

BUG: 469865

Merge request reports