Skip to content

Commit 97bdfeb

Browse files
authored
Merge branch 'python-pillow:main' into usepcf
2 parents f7582b8 + c68cc49 commit 97bdfeb

37 files changed

+354
-238
lines changed

.ci/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pushd depends && ./install_imagequant.sh && popd
5353
pushd depends && sudo ./install_raqm.sh && popd
5454

5555
# libavif
56-
pushd depends && sudo ./install_libavif.sh && popd
56+
pushd depends && ./install_libavif.sh && popd
5757

5858
# extra test images
5959
pushd depends && ./install_extra_test_images.sh && popd

.github/workflows/docs.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,35 @@ jobs:
4848
- name: Build system information
4949
run: python3 .github/workflows/system-info.py
5050

51+
- name: Cache libavif
52+
uses: actions/cache@v5
53+
id: cache-libavif
54+
with:
55+
path: ~/cache-libavif
56+
key: ${{ runner.os }}-libavif-${{ hashFiles('depends/install_libavif.sh', 'depends/libavif-svt4.patch') }}
57+
5158
- name: Cache libimagequant
5259
uses: actions/cache@v5
5360
id: cache-libimagequant
5461
with:
5562
path: ~/cache-libimagequant
5663
key: ${{ runner.os }}-libimagequant-${{ hashFiles('depends/install_imagequant.sh') }}
5764

65+
- name: Cache libwebp
66+
uses: actions/cache@v5
67+
id: cache-libwebp
68+
with:
69+
path: ~/cache-libwebp
70+
key: ${{ runner.os }}-libwebp-${{ hashFiles('depends/install_webp.sh') }}
71+
5872
- name: Install Linux dependencies
5973
run: |
6074
.ci/install.sh
6175
env:
6276
GHA_PYTHON_VERSION: "3.x"
77+
GHA_LIBAVIF_CACHE_HIT: ${{ steps.cache-libavif.outputs.cache-hit }}
6378
GHA_LIBIMAGEQUANT_CACHE_HIT: ${{ steps.cache-libimagequant.outputs.cache-hit }}
79+
GHA_LIBWEBP_CACHE_HIT: ${{ steps.cache-libwebp.outputs.cache-hit }}
6480

6581
- name: Build
6682
run: |

.github/workflows/test-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383

8484
- name: Docker pull
8585
run: |
86-
docker pull pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }}
86+
docker pull ${{ matrix.qemu-arch && format('--platform=linux/{0}', matrix.qemu-arch)}} pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }}
8787
8888
- name: Docker build
8989
run: |

.github/workflows/test.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
- { python-version: "3.14t", disable-gil: true }
6262
- { python-version: "3.13t", disable-gil: true }
6363
# Intel
64-
- { os: "macos-15-intel", python-version: "3.10" }
64+
- { os: "macos-26-intel", python-version: "3.10" }
6565
exclude:
6666
- { os: "macos-latest", python-version: "3.10" }
6767

@@ -91,6 +91,14 @@ jobs:
9191
- name: Build system information
9292
run: python3 .github/workflows/system-info.py
9393

94+
- name: Cache libavif
95+
if: startsWith(matrix.os, 'ubuntu')
96+
uses: actions/cache@v5
97+
id: cache-libavif
98+
with:
99+
path: ~/cache-libavif
100+
key: ${{ runner.os }}-libavif-${{ hashFiles('depends/install_libavif.sh', 'depends/libavif-svt4.patch') }}
101+
94102
- name: Cache libimagequant
95103
if: startsWith(matrix.os, 'ubuntu')
96104
uses: actions/cache@v5
@@ -99,13 +107,23 @@ jobs:
99107
path: ~/cache-libimagequant
100108
key: ${{ runner.os }}-libimagequant-${{ hashFiles('depends/install_imagequant.sh') }}
101109

110+
- name: Cache libwebp
111+
if: startsWith(matrix.os, 'ubuntu')
112+
uses: actions/cache@v5
113+
id: cache-libwebp
114+
with:
115+
path: ~/cache-libwebp
116+
key: ${{ runner.os }}-libwebp-${{ hashFiles('depends/install_webp.sh') }}
117+
102118
- name: Install Linux dependencies
103119
if: startsWith(matrix.os, 'ubuntu')
104120
run: |
105121
.ci/install.sh
106122
env:
107123
GHA_PYTHON_VERSION: ${{ matrix.python-version }}
124+
GHA_LIBAVIF_CACHE_HIT: ${{ steps.cache-libavif.outputs.cache-hit }}
108125
GHA_LIBIMAGEQUANT_CACHE_HIT: ${{ steps.cache-libimagequant.outputs.cache-hit }}
126+
GHA_LIBWEBP_CACHE_HIT: ${{ steps.cache-libwebp.outputs.cache-hit }}
109127

110128
- name: Install macOS dependencies
111129
if: startsWith(matrix.os, 'macOS')

.github/workflows/wheels-dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ else
9696
FREETYPE_VERSION=2.14.1
9797
fi
9898
HARFBUZZ_VERSION=12.3.2
99-
LIBPNG_VERSION=1.6.54
99+
LIBPNG_VERSION=1.6.55
100100
JPEGTURBO_VERSION=3.1.3
101101
OPENJPEG_VERSION=2.5.4
102102
XZ_VERSION=5.8.2

.github/workflows/wheels.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,19 @@ jobs:
5353
include:
5454
- name: "macOS 10.10 x86_64"
5555
platform: macos
56-
os: macos-15-intel
56+
os: macos-26-intel
5757
cibw_arch: x86_64
5858
build: "cp3{10,11}*"
5959
macosx_deployment_target: "10.10"
6060
- name: "macOS 10.13 x86_64"
6161
platform: macos
62-
os: macos-15-intel
62+
os: macos-26-intel
6363
cibw_arch: x86_64
6464
build: "cp3{12,13}*"
6565
macosx_deployment_target: "10.13"
6666
- name: "macOS 10.15 x86_64"
6767
platform: macos
68-
os: macos-15-intel
68+
os: macos-26-intel
6969
cibw_arch: x86_64
7070
build: "{cp314,pp3}*"
7171
macosx_deployment_target: "10.15"
@@ -104,7 +104,7 @@ jobs:
104104
cibw_arch: arm64_iphonesimulator
105105
- name: "iOS x86_64 simulator"
106106
platform: ios
107-
os: macos-15-intel
107+
os: macos-26-intel
108108
cibw_arch: x86_64_iphonesimulator
109109
steps:
110110
- uses: actions/checkout@v6
@@ -250,7 +250,7 @@ jobs:
250250
runs-on: ubuntu-latest
251251
name: Count dists
252252
steps:
253-
- uses: actions/download-artifact@v7
253+
- uses: actions/download-artifact@v8
254254
with:
255255
pattern: dist-*
256256
path: dist
@@ -269,7 +269,7 @@ jobs:
269269
runs-on: ubuntu-latest
270270
name: Upload wheels to scientific-python-nightly-wheels
271271
steps:
272-
- uses: actions/download-artifact@v7
272+
- uses: actions/download-artifact@v8
273273
with:
274274
pattern: dist-!(sdist)*
275275
path: dist
@@ -291,7 +291,7 @@ jobs:
291291
permissions:
292292
id-token: write
293293
steps:
294-
- uses: actions/download-artifact@v7
294+
- uses: actions/download-artifact@v8
295295
with:
296296
pattern: dist-*
297297
path: dist

.pre-commit-config.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.14.14
3+
rev: v0.15.4
44
hooks:
55
- id: ruff-check
66
args: [--exit-non-zero-on-fix]
@@ -11,7 +11,7 @@ repos:
1111
- id: black
1212

1313
- repo: https://github.com/PyCQA/bandit
14-
rev: 1.9.3
14+
rev: 1.9.4
1515
hooks:
1616
- id: bandit
1717
args: [--severity-level=high]
@@ -24,7 +24,7 @@ repos:
2424
exclude: (Makefile$|\.bat$|\.cmake$|\.eps$|\.fits$|\.gd$|\.opt$)
2525

2626
- repo: https://github.com/pre-commit/mirrors-clang-format
27-
rev: v21.1.8
27+
rev: v22.1.0
2828
hooks:
2929
- id: clang-format
3030
types: [c]
@@ -38,6 +38,7 @@ repos:
3838
- repo: https://github.com/pre-commit/pre-commit-hooks
3939
rev: v6.0.0
4040
hooks:
41+
- id: check-case-conflict
4142
- id: check-executables-have-shebangs
4243
- id: check-shebang-scripts-are-executable
4344
- id: check-merge-conflict
@@ -51,7 +52,7 @@ repos:
5152
exclude: ^\.github/.*TEMPLATE|^Tests/(fonts|images)/
5253

5354
- repo: https://github.com/python-jsonschema/check-jsonschema
54-
rev: 0.36.1
55+
rev: 0.37.0
5556
hooks:
5657
- id: check-github-workflows
5758
- id: check-readthedocs
@@ -68,12 +69,12 @@ repos:
6869
- id: sphinx-lint
6970

7071
- repo: https://github.com/tox-dev/pyproject-fmt
71-
rev: v2.12.1
72+
rev: v2.16.2
7273
hooks:
7374
- id: pyproject-fmt
7475

7576
- repo: https://github.com/abravalheri/validate-pyproject
76-
rev: v0.24.1
77+
rev: v0.25
7778
hooks:
7879
- id: validate-pyproject
7980
additional_dependencies: [trove-classifiers>=2024.10.12]

Tests/images/pal8rletrns.png

3.99 KB
Loading

Tests/test_file_bmp.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ def test_rle8_eof(file_name: str, length: int) -> None:
221221
im.load()
222222

223223

224+
def test_rle_delta() -> None:
225+
with Image.open("Tests/images/bmp/q/pal8rletrns.bmp") as im:
226+
assert_image_equal_tofile(im, "Tests/images/pal8rletrns.png")
227+
228+
224229
def test_unsupported_bmp_bitfields_layout() -> None:
225230
fp = io.BytesIO(
226231
o32(40) # header size

Tests/test_file_gif.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,14 @@ def test_roundtrip_save_all_1(tmp_path: Path) -> None:
310310
assert reloaded.getpixel((0, 0)) == 255
311311

312312

313+
@pytest.mark.parametrize("size", ((0, 1), (1, 0), (0, 0)))
314+
def test_save_zero(size: tuple[int, int]) -> None:
315+
b = BytesIO()
316+
im = Image.new("RGB", size)
317+
with pytest.raises(SystemError):
318+
im.save(b, "GIF")
319+
320+
313321
@pytest.mark.parametrize(
314322
"path, mode",
315323
(

0 commit comments

Comments
 (0)