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

If available, use scrot on Linux for ImageGrab #7100

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Re-order options by priority
Co-authored-by: Ondrej Baranovič <3819630+nulano@users.noreply.github.com>
  • Loading branch information
radarhere and nulano authored Apr 26, 2023
commit 4f280e9947c172fdf5afc5e9b5765ff357abe8ef
2 changes: 1 addition & 1 deletion src/PIL/ImageGrab.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def grab(bbox=None, include_layered_windows=False, all_screens=False, xdisplay=N
left, top, right, bottom = bbox
im = im.crop((left - x0, top - y0, right - x0, bottom - y0))
return im
elif shutil.which("gnome-screenshot") or shutil.which("scrot"):
elif shutil.which("scrot") or shutil.which("gnome-screenshot"):
fh, filepath = tempfile.mkstemp(".png")
os.close(fh)
if shutil.which("scrot"): # prefer scrot, as it is less intrusive
Expand Down