mergify[bot]
7c56b383ff
Merge pull request #8842 from AdianKozlica/image_grab_wayland_kde
...
Add KDE Wayland support for ImageGrab
2025-04-01 09:38:56 +00:00
pre-commit-ci[bot]
d2683e052f
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2025-03-30 11:13:51 +00:00
Andrew Murray
80d5b421eb
Do not import type checking
...
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-03-30 22:13:21 +11:00
Andrew Murray
ca9f4f8304
Merge branch 'main' into imagegrab
2025-03-30 21:53:23 +11:00
Andrew Murray
e685e2833e
Do not create temporary file if no utility is available
2025-03-29 18:27:02 +11:00
Adian Kozlica
eeb494abf7
Fix formatting
2025-03-28 17:18:09 +01:00
Adian Kozlica
722283e819
Add KDE Wayland support for ImageGrab
2025-03-28 16:43:10 +01:00
Andrew Murray
f10e9f42d3
Do not use temporary file in grabclipboard() on macOS
2024-12-28 14:29:29 +11:00
Andrew Murray
607acbf95e
Allow window to be supplied for ImageGrab.grab() on Windows
2024-11-05 07:05:39 +11:00
Andrew Murray
ab18395818
Added comment
...
Co-authored-by: Ondrej Baranovič <ondreko.tiba@gmail.com>
2024-06-25 10:50:40 +02:00
Andrew Murray
ded404507b
Removed ignores
2024-06-25 10:50:40 +02:00
Andrew Murray
eb56f3ed56
Removed ignores
2024-06-12 20:56:38 +02:00
Nulano
c2cb944514
Ignore incorrect mypy warning
2024-04-30 16:32:44 +02:00
Nulano
5f805c39cc
Added type hints for PixelAccess methods and others
2024-04-29 23:52:51 +02:00
Andrew Murray
d57b5e827c
Corrected check
2024-01-31 19:10:33 +11:00
Andrew Murray
5efa2ade22
Added test
2024-01-31 19:10:33 +11:00
Andrew Murray
39cbd4f0f1
Expanded error message strings
2024-01-31 19:10:33 +11:00
Andrew Murray
d3205fae19
Simplified code
2024-01-27 22:54:01 +11:00
Nicola Guerrera
6998f34768
Rearrange error handling
...
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
2024-01-27 12:08:16 +01:00
Andrew Murray
d2d9240de4
Do not declare variable until necessary
2024-01-27 20:15:31 +11:00
Andrew Murray
b81341ae7e
Only decode stderr when necessary
2024-01-27 20:15:10 +11:00
Nicola Guerrera
cd640e5df2
Refactor grabclipboard() for x11 and wayland
...
Simpified logic and made it more robust against edge cases ( see the `allowed_errors` list ). Doing error checking this way, makes the behaviour of this function for x11 and wayland platforms more silimar to darwin and windows systems.
fix typo src/PIL/ImageGrab.py
Co-authored-by: Ondrej Baranovič <nulano@nulano.eu>
fix typo src/PIL/ImageGrab.py
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
ImageGrab: \added debian edge case to comment
2024-01-27 10:03:44 +01:00
Hugo van Kemenade
43b2f61e79
Add 'from __future__ import annotations' using Ruff/isort
2023-12-21 13:13:31 +02:00
Hugo van Kemenade
0d1e83098d
Add pyupgrade to pre-commit
2023-09-25 16:45:38 +03:00
Andrew Murray
9c3bc70f66
Use tuples
...
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-08-22 10:31:28 +10:00
TheNooB
e06edcb527
Reformat variable name following PEP8
...
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
2023-08-12 18:33:36 +08:00
TheNooB
0b6ab79145
Check session type using environment variable instead of loginctl
2023-08-12 12:51:09 +08:00
TheNooB
7b157b045a
Use os.getlogin() instead of whoami command for getting username
2023-08-11 21:14:34 +08:00
TheNooB
a8b3feac86
Apply suggestions from code review
...
Simplify conditional expressions
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
2023-08-11 21:01:05 +08:00
pre-commit-ci[bot]
164ea2df6f
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2023-08-11 10:42:12 +00:00
TheNooB
bc658e1791
Add session type check in grabclipboard for Linux
2023-08-11 17:47:36 +08:00
Andrew Murray
e52fa8fe38
Use relevant extension for temporary file
2023-06-17 14:37:13 +02:00
Antoine Beyeler
f72dd8576e
Changed grabclipboard() to use PNG compression on macOS
...
Before, a lossy JPG compression was used.
2023-06-17 12:55:58 +02:00
Andrew Murray
97bd53392c
Do not use temporary file when grabbing clipboard on Linux
2023-06-05 18:36:41 +10:00
Andrew Murray
bce0f0d5a6
Moved function code inline
2023-05-23 21:25:11 +10:00
rrcgat
fffcb558f6
Use image/png mime type for ImageGrab (wl-paste) if possible, otherwise the first mime type taken
2023-05-23 18:44:25 +08:00
Andrew Murray
c656583b84
Merge branch 'main' into fix-imagegrab-with-wl-paste
2023-05-23 08:47:42 +10:00
Andrew Murray
7e29efd518
Do not catch OSError raised when loading image
2023-05-11 16:29:08 +01:00
Andrew Murray
3ec03c6720
Only check for gnome-screenshot on Linux
...
Co-authored-by: Ondrej Baranovič <3819630+nulano@users.noreply.github.com>
2023-05-10 13:53:55 +10:00
nulano
bb18abc603
prefer screenshots using XCB over gnome-screenshot
2023-05-08 22:57:12 +01:00
Andrew Murray
ab3d0c071e
Raise error from stderr of Linux grabclipboard command
2023-04-24 21:03:27 +10:00
Andrew Murray
f15d7265f7
Call init() if mimetype is not found with preinit()
2023-04-18 10:33:31 +10:00
Carl Weaver
6d12581385
Update src/PIL/ImageGrab.py
...
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
2023-04-16 15:37:38 +08:00
rrcgat
099d696dc7
Fix ImageGrab with wl-paste
2023-04-15 19:28:54 +08:00
Hugo van Kemenade
2ae55ccbda
Improve exception traceback readability
2022-12-30 00:07:52 +02:00
Andrew Murray
2ecf88eaa6
If available, use xclip for grabclipboard() on Linux
2022-12-07 22:01:37 +11:00
Andrew Murray
ccac854077
If available, use wl-paste for grabclipboard() on Linux
2022-12-07 21:33:09 +11:00
Andrew Murray
b1ba0909ed
Prefer gnome-screenshot if xdisplay is None
...
Co-authored-by: Ondrej Baranovič <nulano@nulano.eu>
2022-06-13 09:56:52 +10:00
Andrew Murray
a48d95061d
Use gnome-screenshot on Linux if available
2022-06-12 16:00:31 +10:00
axt-one
9fb0087ec2
modified screencapture option in ImageGrab.grab()
2022-04-26 18:04:08 +09:00