All checks were successful
Push image to registry / build-image (push) Successful in 4m44s
22 lines
537 B
PHP
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 '';
|
|
}
|
|
}
|
|
}
|