Skip to content
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

Issue with blank images #14

Open
mcm246 opened this issue Jul 5, 2024 · 0 comments
Open

Issue with blank images #14

mcm246 opened this issue Jul 5, 2024 · 0 comments

Comments

@mcm246
Copy link

mcm246 commented Jul 5, 2024

Hi! Thanks for your work on this package, it's awesome!

I've been running into an issue with some "images" where the program crashes at line 119 while trying to iterate over the OCR results. It seems like the 'success' variable is returning true even though there were no results available. I've pasted the program output below as well as a sample image which you should be able to use to reproduce the issue. A quick fix could be to check to confirm that there actually are results alongside the 'success' check in line 118 (although what's confusing to me is that I've tested this on some other blank images that correctly returned an empty list as expected...).

Traceback (most recent call last): File "[...]/test.py", line 72, in <module> annotations = ocrmac.OCR('/blank_image.png').recognize() File "[...]/lib/python3.9/site-packages/ocrmac/ocrmac.py", line 158, in recognize res = text_from_image( File "[...]/lib/python3.9/site-packages/ocrmac/ocrmac.py", line 119, in text_from_image for result in req.results(): TypeError: 'NoneType' object is not iterable

Blank image example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant