diff --git a/routes/web.php b/routes/web.php index 6c9243adb..501b79012 100644 --- a/routes/web.php +++ b/routes/web.php @@ -39,7 +39,12 @@ use thiagoalessio\TesseractOCR\TesseractOCR; } 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]); } catch (\Exception $e) { return response()->json(['success' => false, 'error' => $e->getMessage()]);