mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-20 17:22:00 +03:00
Merge af3a1fdc15
into d546233be4
This commit is contained in:
commit
dfbef204c5
|
@ -43,6 +43,7 @@ class TestImageGrab:
|
|||
if (
|
||||
sys.platform not in ("win32", "darwin")
|
||||
and not shutil.which("gnome-screenshot")
|
||||
and not shutil.which("grim")
|
||||
and not shutil.which("spectacle")
|
||||
):
|
||||
with pytest.raises(OSError) as e:
|
||||
|
|
|
@ -16,7 +16,7 @@ or the clipboard to a PIL image memory.
|
|||
the entire screen is copied, and on macOS, it will be at 2x if on a Retina screen.
|
||||
|
||||
On Linux, if ``xdisplay`` is ``None`` and the default X11 display does not return
|
||||
a snapshot of the screen, ``gnome-screenshot`` or ``spectacle`` will be used as a
|
||||
a snapshot of the screen, ``gnome-screenshot``, ``grim`` or ``spectacle`` will be used as a
|
||||
fallback if they are installed. To disable this behaviour, pass ``xdisplay=""``
|
||||
instead.
|
||||
|
||||
|
|
|
@ -89,6 +89,8 @@ def grab(
|
|||
if display_name is None and sys.platform not in ("darwin", "win32"):
|
||||
if shutil.which("gnome-screenshot"):
|
||||
args = ["gnome-screenshot", "-f"]
|
||||
elif shutil.which("grim"):
|
||||
args = ["grim"]
|
||||
elif shutil.which("spectacle"):
|
||||
args = ["spectacle", "-n", "-b", "-f", "-o"]
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user