addeed file path of ocr
This commit is contained in:
@@ -39,7 +39,12 @@ use thiagoalessio\TesseractOCR\TesseractOCR;
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$text = (new TesseractOCR($filePath))->lang('eng')->run();
|
// $text = (new TesseractOCR($filePath))->lang('eng')->run();
|
||||||
|
$text = (new TesseractOCR($filePath))
|
||||||
|
->executable('/usr/bin/tesseract')
|
||||||
|
->lang('eng')
|
||||||
|
->run();
|
||||||
|
|
||||||
return response()->json(['success' => true, 'text' => $text]);
|
return response()->json(['success' => true, 'text' => $text]);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return response()->json(['success' => false, 'error' => $e->getMessage()]);
|
return response()->json(['success' => false, 'error' => $e->getMessage()]);
|
||||||
|
|||||||
Reference in New Issue
Block a user