addeed file path of ocr

This commit is contained in:
dhanabalan
2025-10-18 10:58:57 +05:30
parent 7152322da7
commit 721b9b4fd1

View File

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