Skip to content

Commit

Permalink
Merge pull request #7219 from abey79/grabclipboard-mac-png
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jun 18, 2023
2 parents 99a6765 + e52fa8f commit 934a6c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Changelog (Pillow)
10.0.0 (unreleased)
-------------------

- Changed grabclipboard() to use PNG instead of JPG compression on macOS #7219
[abey79]

- Added in_place argument to ImageOps.exif_transpose() #7092
[radarhere]

Expand Down
4 changes: 2 additions & 2 deletions src/PIL/ImageGrab.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ def grab(bbox=None, include_layered_windows=False, all_screens=False, xdisplay=N

def grabclipboard():
if sys.platform == "darwin":
fh, filepath = tempfile.mkstemp(".jpg")
fh, filepath = tempfile.mkstemp(".png")
os.close(fh)
commands = [
'set theFile to (open for access POSIX file "'
+ filepath
+ '" with write permission)',
"try",
" write (the clipboard as JPEG picture) to theFile",
" write (the clipboard as «class PNGf») to theFile",
"end try",
"close access theFile",
]
Expand Down

0 comments on commit 934a6c6

Please sign in to comment.