From: Michael Date: Mon, 22 Jan 2024 18:01:51 +0000 (+0000) Subject: Tesseract: Improved detection X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8b35c9fddba1cd7695a33ce4d9aa5e2d9dd312b2;p=friendica-addons.git Tesseract: Improved detection --- diff --git a/tesseract/tesseract.php b/tesseract/tesseract.php index 3c61273f..b3e1feb6 100644 --- a/tesseract/tesseract.php +++ b/tesseract/tesseract.php @@ -24,6 +24,10 @@ function tesseract_ocr_detection(&$media) { $ocr = new TesseractOCR(); try { + $languages = $ocr->availableLanguages(); + if ($languages) { + $ocr->lang(implode('+', $languages)); + } $ocr->tempDir(System::getTempPath()); $ocr->imageData($media['img_str'], strlen($media['img_str'])); $media['description'] = $ocr->run();