Open orange-puff opened 1 year ago
It's funny, I was thinking about that exact behavior. I think I will make the auto-scaling an optional feature rather than the default behavior. It will also fix several issues I saw here, and there, like:
I will try something and rely on the CI (and maybe you) for the testing, since I don't own a Mac machine yet.
I would be happy to test this. Also, sorry for the off topic question. Is there a link to any documentation of why mss is so fast compared to pillow or pyautogui? It's performing much better on my computer than either of them.
I was hoping to test this locally, but the docs look outdated, https://python-mss.readthedocs.io/developers.html python -m pip install -r tests-requirements.txt
but this file doesn't seem to exist.
Is there an updated guide for getting things running locally? I am also getting
from . import __version__
ImportError: attempted relative import with no known parent package
when attempting to run main.py. I've researched this error extensively in other contexts and I cannot find a working solution for it
Thanks for pointing the documentation issue, it's broken since my last commit, and I'll fix it.
To run main:
cd src
python -m mss
You should remove any older MSS installation first:
python -m pip uninstall -y mss
And here is the correct installation command:
python -m pip install -e '.[test]'
So I did this, then added
import pyautogui
if __name__ == "__main__": # pragma: nocover
w, h = pyautogui.size()
print(w,h)
with mss() as sct:
monitor = {"top": 0, "left": 0, "width": w, "height": h}
mss_image = sct.grab(monitor)
print(f'({w}, {h}) ({mss_image.width}, {mss_image.height})')
to src/mss/__main__.py
and I get
1440 900
zsh: segmentation fault python3 -m mss
The line that is throwing the exception is; https://github.com/BoboTiG/python-mss/blob/main/src/mss/darwin.py#L181
If I rerun I also get
zsh: bus error python3 -m mss
zsh: illegal hardware instruction python3 -m mss
Without knowing what the underlying dll looks like, it's not easy to go deeper. But I will try to look at the arg and how the PR might have contributed
Actually the PR isn't working. I quickly tried something, but without a Mac machine it's complex. I will receive a Mac machine by the next week, and will be able to work on it then.
General information:
OS name: macOS Big Sur
OS version: 11.1
OS architecture: 64 bits
Resolutions:
Python version: 3.10.7
MSS version: 9.0.1
Description
When I run the following code:
it results in
(1440, 900) (2880, 1800)
This interferes with my ability to then use
pyautogui
to find certain pixels with a given color and click them. Is there a way to turn scaling off inmss
, or is this perhaps a macOS issue?Upvote & Fund