thiagoalessio / tesseract-ocr-for-php

A wrapper to work with Tesseract OCR inside PHP.
https://packagist.org/packages/thiagoalessio/tesseract_ocr
MIT License
2.87k stars 551 forks source link

Add support for reading image data from string #170

Closed LeCodeurDuDimanche closed 5 years ago

LeCodeurDuDimanche commented 5 years ago

Description

Add imageData() method which uses an already loaded image as an input instead of a file path. Add withoutTempFiles() method which prevent TesseractOCR from creating temporary files and use standard output to retrieve the data from tesseract.

Related Issues

Resolves #147 Allows to use images without saving them beforehand. Improve efficiency by avoiding to write to the file-system.

LeCodeurDuDimanche commented 5 years ago

The tests are now successful (apart from the AppVeyor one, but it is not passing because of a missing package). Should I submit a new pull request with a cleaner commit history and close this one ?

thiagoalessio commented 5 years ago

@LeCodeurDuDimanche awesome! :tada: :balloon: don't worry about AppVeyor, probably that package was renamed, i gotta sort that out. No need to clean up the commit history, I'll try to set aside some time this weekend to play around with your changes. Thank you so much for addressing that issue, it was sitting there for almost one year. Let's hope I don't take another year to merge your PR :rofl: :heart: :green_heart: :yellow_heart: :blue_heart: :purple_heart: :black_heart:

LeCodeurDuDimanche commented 5 years ago

Nice ! :smiley:

thiagoalessio commented 5 years ago

Your changes are available in version 2.8.0, thanks for taking the time to contribute!