Tesseract: Improved detection #1459

Merged
MrPetovan merged 1 commit from heluecht/friendica-addons:tesseract-languages into develop 2024-01-22 19:14:56 +01:00
Showing only changes of commit 1b7e699944 - Show all commits

View file

@ -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();