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

'ScreenShot' object has no attribute 'thumbnail' #53

Open
OlegSmoliakov opened this issue Oct 3, 2023 · 0 comments
Open

'ScreenShot' object has no attribute 'thumbnail' #53

OlegSmoliakov opened this issue Oct 3, 2023 · 0 comments

Comments

@OlegSmoliakov
Copy link

OlegSmoliakov commented Oct 3, 2023

I use MacBook with Retina display, so when I ran the simple code below:

from python_imagesearch import imagesearch

img = "pics/testimg.png"
print(imagesearch.imagesearch(img))

I got this error:

.venv/lib/python3.11/site-packages/python_imagesearch/imagesearch.py", line 124, in imagesearch 
im.thumbnail((round(im.size[0] * 0.5), round(im.size[1] * 0.5)))
^^^^^^^^^^^^
AttributeError: 'ScreenShot' object has no attribute 'thumbnail'

It looks like conditions with the is_retina variable doesn't work properly, because if I comment these lines:

If platform.system() == "Darwin":
    is_retina = subprocess.call("system_profiler SPDisplaysDataType | grep -i 'retina'", shell=True) == 0

The code will execute without errors, but I'm not sure that trick won't break anything. 🤔

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