Skip to content

Commit 68edbbc

Browse files
committed
Merge branch 'main' into int_def
2 parents f6b516b + 8f3ccff commit 68edbbc

40 files changed

Lines changed: 341 additions & 187 deletions

.ci/install.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ set -e
2222
if [[ $(uname) != CYGWIN* ]]; then
2323
sudo apt-get -qq install libfreetype6-dev liblcms2-dev python3-tk\
2424
ghostscript libffi-dev libjpeg-turbo-progs libopenjp2-7-dev\
25-
cmake meson imagemagick libharfbuzz-dev libfribidi-dev
25+
cmake meson imagemagick libharfbuzz-dev libfribidi-dev\
26+
sway wl-clipboard
2627
fi
2728

2829
python3 -m pip install --upgrade pip
@@ -41,7 +42,7 @@ if [[ $(uname) != CYGWIN* ]]; then
4142
if ! [ "$GHA_PYTHON_VERSION" == "3.12-dev" ]; then python3 -m pip install numpy ; fi
4243

4344
# PyQt6 doesn't support PyPy3
44-
if [[ $GHA_PYTHON_VERSION == 3.* ]]; then
45+
if [[ "$GHA_PYTHON_VERSION" != "3.12-dev" && $GHA_PYTHON_VERSION == 3.* ]]; then
4546
sudo apt-get -qq install libegl1 libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxkbcommon-x11-0
4647
python3 -m pip install pyqt6
4748
fi

.editorconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ indent_style = space
1313

1414
trim_trailing_whitespace = true
1515

16-
[*.rst]
17-
# Four-space indentation
18-
indent_size = 4
19-
2016
[*.yml]
2117
# Two-space indentation
2218
indent_size = 2

.github/workflows/test-docker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
centos-stream-8-amd64,
4040
centos-stream-9-amd64,
4141
debian-11-bullseye-x86,
42+
debian-12-bookworm-x86,
4243
fedora-37-amd64,
4344
fedora-38-amd64,
4445
gentoo,

.github/workflows/test-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ jobs:
6565
- name: Print build system information
6666
run: python3 .github/workflows/system-info.py
6767

68-
- name: python3 -m pip install wheel pytest pytest-cov pytest-timeout defusedxml
69-
run: python3 -m pip install wheel pytest pytest-cov pytest-timeout defusedxml
68+
- name: python3 -m pip install setuptools wheel pytest pytest-cov pytest-timeout defusedxml
69+
run: python3 -m pip install setuptools wheel pytest pytest-cov pytest-timeout defusedxml
7070

7171
- name: Install dependencies
7272
id: install

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ jobs:
8484
python3 -m pip install pytest-reverse
8585
fi
8686
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
87-
xvfb-run -s '-screen 0 1024x768x24' .ci/test.sh
87+
xvfb-run -s '-screen 0 1024x768x24' sway&
88+
export WAYLAND_DISPLAY=wayland-1
89+
.ci/test.sh
8890
else
8991
.ci/test.sh
9092
fi

.pre-commit-config.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ repos:
44
hooks:
55
- id: black
66
args: [--target-version=py38]
7-
# Only .py files, until https://github.com/psf/black/issues/402 resolved
8-
files: \.py$
9-
types: []
107

118
- repo: https://github.com/PyCQA/isort
129
rev: 5.12.0

CHANGES.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,30 @@ Changelog (Pillow)
55
10.0.0 (unreleased)
66
-------------------
77

8+
- Fixed combining single duration across duplicate APNG frames #7146
9+
[radarhere]
10+
11+
- Remove temporary file when error is raised #7148
12+
[radarhere]
13+
14+
- Do not use temporary file when grabbing clipboard on Linux #7200
15+
[radarhere]
16+
17+
- If the clipboard fails to open on Windows, wait and try again #7141
18+
[radarhere]
19+
20+
- Fixed saving multiple 1 mode frames to GIF #7181
21+
[radarhere]
22+
23+
- Replaced absolute PIL import with relative import #7173
24+
[radarhere]
25+
26+
- Replaced deprecated Py_FileSystemDefaultEncoding for Python >= 3.12 #7192
27+
[radarhere]
28+
29+
- Improved wl-paste mimetype handling in ImageGrab #7094
30+
[rrcgat, radarhere]
31+
832
- Added _repr_jpeg_() for IPython display_jpeg #7135
933
[n3011, radarhere, nulano]
1034

Tests/test_file_apng.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,17 @@ def test_apng_save_duration_loop(tmp_path):
447447
assert im.info.get("duration") == 750
448448

449449

450+
def test_apng_save_duplicate_duration(tmp_path):
451+
test_file = str(tmp_path / "temp.png")
452+
frame = Image.new("RGB", (1, 1))
453+
454+
# Test a single duration is correctly combined across duplicate frames
455+
frame.save(test_file, save_all=True, append_images=[frame, frame], duration=500)
456+
with Image.open(test_file) as im:
457+
assert im.n_frames == 1
458+
assert im.info.get("duration") == 1500
459+
460+
450461
def test_apng_save_disposal(tmp_path):
451462
test_file = str(tmp_path / "temp.png")
452463
size = (128, 64)

Tests/test_file_gif.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,19 @@ def test_roundtrip_save_all(tmp_path):
252252
assert reread.n_frames == 5
253253

254254

255+
def test_roundtrip_save_all_1(tmp_path):
256+
out = str(tmp_path / "temp.gif")
257+
im = Image.new("1", (1, 1))
258+
im2 = Image.new("1", (1, 1), 1)
259+
im.save(out, save_all=True, append_images=[im2])
260+
261+
with Image.open(out) as reloaded:
262+
assert reloaded.getpixel((0, 0)) == 0
263+
264+
reloaded.seek(1)
265+
assert reloaded.getpixel((0, 0)) == 255
266+
267+
255268
@pytest.mark.parametrize(
256269
"path, mode",
257270
(

Tests/test_file_tiff.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,17 @@ def test_mac_tiff(self):
9696

9797
assert_image_similar_tofile(im, "Tests/images/pil136.png", 1)
9898

99-
def test_bigtiff(self):
99+
def test_bigtiff(self, tmp_path):
100100
with Image.open("Tests/images/hopper_bigtiff.tif") as im:
101101
assert_image_equal_tofile(im, "Tests/images/hopper.tif")
102102

103+
with Image.open("Tests/images/hopper_bigtiff.tif") as im:
104+
# multistrip support not yet implemented
105+
del im.tag_v2[273]
106+
107+
outfile = str(tmp_path / "temp.tif")
108+
im.save(outfile, save_all=True, append_images=[im], tiffinfo=im.tag_v2)
109+
103110
def test_set_legacy_api(self):
104111
ifd = TiffImagePlugin.ImageFileDirectory_v2()
105112
with pytest.raises(Exception) as e:

0 commit comments

Comments
 (0)