Merge pull request #6244 from axt-one/fix-darwin-screencapture-bug

Corrected screencapture argument in ImageGrab.grab()
This commit is contained in:
Andrew Murray 2022-04-26 20:53:07 +10:00 committed by GitHub
commit bb879d7b41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ def grab(bbox=None, include_layered_windows=False, all_screens=False, xdisplay=N
args = ["screencapture"]
if bbox:
left, top, right, bottom = bbox
args += ["-R", f"{left},{right},{right-left},{bottom-top}"]
args += ["-R", f"{left},{top},{right-left},{bottom-top}"]
subprocess.call(args + ["-x", filepath])
im = Image.open(filepath)
im.load()