mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-12-22 15:10:21 +00:00
Tesseract: Improved detection
This commit is contained in:
parent
446fd9b17b
commit
8b35c9fddb
1 changed files with 4 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue