Files
DatBrowser/app/Services/FileTools/OCR/TesseractImageOCR.php
Matthias Guillitte fcc78fd560
All checks were successful
Push image to registry / build-image (push) Successful in 4m44s
fix tesseract
2025-07-01 11:57:51 +02:00

22 lines
537 B
PHP

<?php
namespace App\Services\FileTools\OCR;
use thiagoalessio\TesseractOCR\TesseractOCR;
class TesseractImageOCR implements IImageOCR
{
/**
* @inheritDoc
*/
public function performOCR(string $filePath): string {
try {
$tesseract = new TesseractOCR($filePath);
return $tesseract->run();
} catch (\Exception $e) {
// Handle the exception, log it, or rethrow it as needed
// For now, we just return an empty string
return '';
}
}
}