-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errno::EPIPE on certain png images #7
Comments
Thanks, although I've just been updating Tika as new versions are released. The gem is mostly the work of https://github.com/yomurb/yomu (been inactive for some time). Hmm so it seems like Tika is closing the pipe before Henkei has finished writing the image file. Can Tika even extract text out of a PNG? Or is this just a repeatable use-case you've found? One option would be to capture a pipe exception and handle it in a more gracious manner. Return nil? Raise some other exception? Hmm.. not a fan This is certainly not the first time this issue has come up.. see yomurb#7 (unresolved) I'll have a look to see if there is a better way to pipe the data into Tika, but open to suggestions |
I'm actually not sure if Tika can extract text from a png or not. My app just tries to extract text from any uploaded file. I agree that ideally the root of the problem would be fixed, but even just being able to Thoughts? |
interestingly, using the following in the
although I need to do some more research into the differences between writing to a Ruby IO vs using Ruby Shell On the limited number of files I've tested it with, I get the expected results. |
@rywall did you get a chance to try my suggestion? |
@abrom I've been using your suggestion in production for the past couple of weeks and it seems to be working great. 😄 |
First off, great work on this gem. It works amazingly well 99.9% of the time.
I've encountered certain png images (one uploaded as test2.png) that produce an
Errno::EPIPE
error when calling.text
. I would expect either an empty string (like test1.png) or a more intelligible error message from Henkei.test1.png
test2.png
The text was updated successfully, but these errors were encountered: