Skip to content

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

@OlegSmoliakov

Description

@OlegSmoliakov

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. 🤔

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions