Closed s811645 closed 3 years ago
This is happening because you seem to be sharing $this->tesseract
instance, which can lead to this kind of race condition, since temp filenames are stored as instance variables.
To avoid this, my suggestion is to spawn a new instance every time
(replace $this->tesseract->....
by (new TesseractOCR())->...
).
I do my script with using tesseract with PHP, script working fine for 1-2-3 requests simultaneously. But, if i send 10+ requests simultaneously its done first 2-3 request, but for next show error:
Any idea why this can happen?
I check in Therminal version tesseract and this show 4.1.4 (photo)
My Code: `$this->Imagick->readImageBlob($result); $this->Imagick->resizeImage(450,120,Imagick::FILTER_CATROM,1); $this->Imagick->extentImage(450,120,Imagick::FILTER_CATROM,1);
// some other options imagick.. $data = $this->Imagick->getImageBlob(); $size = $this->Imagick->getImageLength(); // read image $this->tesseract->imageData($data, $size)->lang('eng'); $code = $this->tesseract->run(); $this->tesseract->clearCache();`