Skip to content

Commit 6f45852

Browse files
authored
Merge branch 'main' into fix-qtables-and-quality-scaling
2 parents 630265f + 3d41195 commit 6f45852

25 files changed

+68
-980
lines changed

.github/workflows/test-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ jobs:
4747
centos-stream-10-amd64,
4848
debian-12-bookworm-x86,
4949
debian-12-bookworm-amd64,
50-
fedora-40-amd64,
5150
fedora-41-amd64,
51+
fedora-42-amd64,
5252
gentoo,
5353
ubuntu-22.04-jammy-amd64,
5454
ubuntu-24.04-noble-amd64,

.github/workflows/wheels-dependencies.sh

Lines changed: 3 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ ARCHIVE_SDIR=pillow-depends-main
3838

3939
# Package versions for fresh source builds
4040
FREETYPE_VERSION=2.13.3
41-
HARFBUZZ_VERSION=11.0.0
41+
HARFBUZZ_VERSION=11.0.1
4242
LIBPNG_VERSION=1.6.47
4343
JPEGTURBO_VERSION=3.1.0
4444
OPENJPEG_VERSION=2.5.3
45-
XZ_VERSION=5.8.0
45+
XZ_VERSION=5.8.1
4646
TIFF_VERSION=4.7.0
4747
LCMS2_VERSION=2.17
4848
ZLIB_VERSION=1.3.1
@@ -51,21 +51,6 @@ LIBWEBP_VERSION=1.5.0
5151
BZIP2_VERSION=1.0.8
5252
LIBXCB_VERSION=1.17.0
5353
BROTLI_VERSION=1.1.0
54-
LIBAVIF_VERSION=1.2.1
55-
56-
if [[ $MB_ML_VER == 2014 ]]; then
57-
function build_xz {
58-
if [ -e xz-stamp ]; then return; fi
59-
yum install -y gettext-devel
60-
fetch_unpack https://tukaani.org/xz/xz-$XZ_VERSION.tar.gz
61-
(cd xz-$XZ_VERSION \
62-
&& ./autogen.sh --no-po4a \
63-
&& ./configure --prefix=$BUILD_PREFIX \
64-
&& make -j4 \
65-
&& make install)
66-
touch xz-stamp
67-
}
68-
fi
6954

7055
function build_pkg_config {
7156
if [ -e pkg-config-stamp ]; then return; fi
@@ -107,51 +92,12 @@ function build_harfbuzz {
10792

10893
local out_dir=$(fetch_unpack https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION/harfbuzz-$HARFBUZZ_VERSION.tar.xz harfbuzz-$HARFBUZZ_VERSION.tar.xz)
10994
(cd $out_dir \
110-
&& meson setup build --prefix=$BUILD_PREFIX --libdir=$BUILD_PREFIX/lib --buildtype=release -Dfreetype=enabled -Dglib=disabled)
95+
&& meson setup build --prefix=$BUILD_PREFIX --libdir=$BUILD_PREFIX/lib --buildtype=release -Dfreetype=enabled -Dglib=disabled -Dtests=disabled)
11196
(cd $out_dir/build \
11297
&& meson install)
11398
touch harfbuzz-stamp
11499
}
115100

116-
function build_libavif {
117-
if [ -e libavif-stamp ]; then return; fi
118-
119-
python3 -m pip install meson ninja
120-
121-
if [[ "$PLAT" == "x86_64" ]] || [ -n "$SANITIZER" ]; then
122-
build_simple nasm 2.16.03 https://www.nasm.us/pub/nasm/releasebuilds/2.16.03
123-
fi
124-
125-
# For rav1e
126-
curl https://sh.rustup.rs -sSf | sh -s -- -y
127-
. "$HOME/.cargo/env"
128-
if [ -z "$IS_ALPINE" ] && [ -z "$SANITIZER" ] && [ -z "$IS_MACOS" ]; then
129-
yum install -y perl
130-
if [[ "$MB_ML_VER" == 2014 ]]; then
131-
yum install -y perl-IPC-Cmd
132-
fi
133-
fi
134-
135-
local out_dir=$(fetch_unpack https://github.com/AOMediaCodec/libavif/archive/refs/tags/v$LIBAVIF_VERSION.tar.gz libavif-$LIBAVIF_VERSION.tar.gz)
136-
(cd $out_dir \
137-
&& CMAKE_POLICY_VERSION_MINIMUM=3.5 cmake \
138-
-DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX \
139-
-DCMAKE_INSTALL_LIBDIR=$BUILD_PREFIX/lib \
140-
-DCMAKE_BUILD_TYPE=Release \
141-
-DBUILD_SHARED_LIBS=OFF \
142-
-DAVIF_LIBSHARPYUV=LOCAL \
143-
-DAVIF_LIBYUV=LOCAL \
144-
-DAVIF_CODEC_AOM=LOCAL \
145-
-DAVIF_CODEC_DAV1D=LOCAL \
146-
-DAVIF_CODEC_RAV1E=LOCAL \
147-
-DAVIF_CODEC_SVT=LOCAL \
148-
-DENABLE_NASM=ON \
149-
-DCMAKE_MODULE_PATH=/tmp/cmake/Modules \
150-
. \
151-
&& make install)
152-
touch libavif-stamp
153-
}
154-
155101
function build {
156102
build_xz
157103
if [ -z "$IS_ALPINE" ] && [ -z "$SANITIZER" ] && [ -z "$IS_MACOS" ]; then
@@ -186,7 +132,6 @@ function build {
186132
build_tiff
187133
fi
188134

189-
build_libavif
190135
build_libpng
191136
build_lcms2
192137
build_openjpeg

.github/workflows/wheels.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,17 @@ jobs:
121121
windows:
122122
if: github.event_name != 'schedule' || github.repository_owner == 'python-pillow'
123123
name: Windows ${{ matrix.cibw_arch }}
124-
runs-on: windows-latest
124+
runs-on: ${{ matrix.os }}
125125
strategy:
126126
fail-fast: false
127127
matrix:
128128
include:
129129
- cibw_arch: x86
130+
os: windows-latest
130131
- cibw_arch: AMD64
132+
os: windows-latest
131133
- cibw_arch: ARM64
134+
os: windows-11-arm
132135
steps:
133136
- uses: actions/checkout@v4
134137
with:
@@ -157,14 +160,9 @@ jobs:
157160
# Install extra test images
158161
xcopy /S /Y Tests\test-images\* Tests\images
159162
160-
& python.exe winbuild\build_prepare.py -v --no-imagequant --architecture=${{ matrix.cibw_arch }}
163+
& python.exe winbuild\build_prepare.py -v --no-imagequant --no-avif --architecture=${{ matrix.cibw_arch }}
161164
shell: pwsh
162165

163-
- name: Update rust
164-
if: matrix.cibw_arch == 'AMD64'
165-
run: |
166-
rustup update
167-
168166
- name: Build wheels
169167
run: |
170168
setlocal EnableDelayedExpansion

Tests/check_wheel.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
import platform
4-
import struct
54
import sys
65

76
from PIL import features
@@ -10,7 +9,7 @@
109

1110

1211
def test_wheel_modules() -> None:
13-
expected_modules = {"pil", "tkinter", "freetype2", "littlecms2", "webp", "avif"}
12+
expected_modules = {"pil", "tkinter", "freetype2", "littlecms2", "webp"}
1413

1514
# tkinter is not available in cibuildwheel installed CPython on Windows
1615
try:
@@ -20,11 +19,6 @@ def test_wheel_modules() -> None:
2019
except ImportError:
2120
expected_modules.remove("tkinter")
2221

23-
# libavif is not available on Windows for x86 and ARM64 architectures
24-
if sys.platform == "win32":
25-
if platform.machine() == "ARM64" or struct.calcsize("P") == 4:
26-
expected_modules.remove("avif")
27-
2822
assert set(features.get_supported_modules()) == expected_modules
2923

3024

Tests/test_file_bmp.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ def test_rle8() -> None:
190190
# Signal end of bitmap before the image is finished
191191
with open("Tests/images/bmp/g/pal8rle.bmp", "rb") as fp:
192192
data = fp.read(1063) + b"\x01"
193-
with Image.open(io.BytesIO(data)) as im:
194-
with pytest.raises(ValueError):
195-
im.load()
193+
with Image.open(io.BytesIO(data)) as im:
194+
with pytest.raises(ValueError):
195+
im.load()
196196

197197

198198
def test_rle4() -> None:
@@ -214,9 +214,9 @@ def test_rle4() -> None:
214214
def test_rle8_eof(file_name: str, length: int) -> None:
215215
with open(file_name, "rb") as fp:
216216
data = fp.read(length)
217-
with Image.open(io.BytesIO(data)) as im:
218-
with pytest.raises(ValueError):
219-
im.load()
217+
with Image.open(io.BytesIO(data)) as im:
218+
with pytest.raises(ValueError):
219+
im.load()
220220

221221

222222
def test_offset() -> None:

Tests/test_file_jpeg2k.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,8 @@ def test_comment() -> None:
457457
# Test an image that is truncated partway through a codestream
458458
with open("Tests/images/comment.jp2", "rb") as fp:
459459
b = BytesIO(fp.read(130))
460-
with Image.open(b) as im:
461-
pass
460+
with Image.open(b) as im:
461+
pass
462462

463463

464464
def test_save_comment(card: ImageFile.ImageFile) -> None:

Tests/test_file_libtiff.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def test_g4_tiff_bytesio(self, tmp_path: Path) -> None:
8181
s = io.BytesIO()
8282
with open(test_file, "rb") as f:
8383
s.write(f.read())
84-
s.seek(0)
84+
s.seek(0)
8585
with Image.open(s) as im:
8686
assert im.size == (500, 500)
8787
self._assert_noerr(tmp_path, im)
@@ -1050,12 +1050,12 @@ def test_old_style_jpeg_orientation(self) -> None:
10501050
with open("Tests/images/old-style-jpeg-compression.tif", "rb") as fp:
10511051
data = fp.read()
10521052

1053-
# Set EXIF Orientation to 2
1054-
data = data[:102] + b"\x02" + data[103:]
1053+
# Set EXIF Orientation to 2
1054+
data = data[:102] + b"\x02" + data[103:]
10551055

1056-
with Image.open(io.BytesIO(data)) as im:
1057-
im = im.transpose(Image.Transpose.FLIP_LEFT_RIGHT)
1058-
assert_image_equal_tofile(im, "Tests/images/old-style-jpeg-compression.png")
1056+
with Image.open(io.BytesIO(data)) as im:
1057+
im = im.transpose(Image.Transpose.FLIP_LEFT_RIGHT)
1058+
assert_image_equal_tofile(im, "Tests/images/old-style-jpeg-compression.png")
10591059

10601060
def test_open_missing_samplesperpixel(self) -> None:
10611061
with Image.open(

Tests/test_file_libtiff_small.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def test_g4_hopper_bytesio(self, tmp_path: Path) -> None:
3232
s = BytesIO()
3333
with open(test_file, "rb") as f:
3434
s.write(f.read())
35-
s.seek(0)
35+
s.seek(0)
3636
with Image.open(s) as im:
3737
assert im.size == (128, 128)
3838
self._assert_noerr(tmp_path, im)

docs/deprecations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ ExifTags.IFD.Makernote
186186
Image.Image.get_child_images()
187187
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
188188

189-
.. deprecated:: 11.2.0
189+
.. deprecated:: 11.2.1
190190

191191
``Image.Image.get_child_images()`` has been deprecated. and will be removed in Pillow
192192
13 (2026-10-15). It will be moved to ``ImageFile.ImageFile.get_child_images()``. The

docs/handbook/image-file-formats.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ DXT1 and DXT5 pixel formats can be read, only in ``RGBA`` mode.
170170
in ``P`` mode.
171171

172172

173-
.. versionadded:: 11.2.0
173+
.. versionadded:: 11.2.1
174174
DXT1, DXT3, DXT5, BC2, BC3 and BC5 pixel formats can be saved::
175175

176176
im.save(out, pixel_format="DXT1")
@@ -1671,6 +1671,11 @@ The :py:meth:`~PIL.Image.open` method sets the following
16711671
Transparency color index. This key is omitted if the image is not
16721672
transparent.
16731673

1674+
XV Thumbnails
1675+
^^^^^^^^^^^^^
1676+
1677+
Pillow can read XV thumbnail files.
1678+
16741679
Write-only formats
16751680
------------------
16761681

@@ -1776,11 +1781,6 @@ The :py:meth:`~PIL.Image.Image.save` method can take the following keyword argum
17761781

17771782
.. versionadded:: 5.3.0
17781783

1779-
XV Thumbnails
1780-
^^^^^^^^^^^^^
1781-
1782-
Pillow can read XV thumbnail files.
1783-
17841784
Identify-only formats
17851785
---------------------
17861786

docs/installation/platform-support.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ These platforms are built and tested for every change.
2323
+----------------------------------+----------------------------+---------------------+
2424
| Amazon Linux 2023 | 3.9 | x86-64 |
2525
+----------------------------------+----------------------------+---------------------+
26-
| Arch | 3.12 | x86-64 |
26+
| Arch | 3.13 | x86-64 |
2727
+----------------------------------+----------------------------+---------------------+
2828
| CentOS Stream 9 | 3.9 | x86-64 |
2929
+----------------------------------+----------------------------+---------------------+
3030
| CentOS Stream 10 | 3.12 | x86-64 |
3131
+----------------------------------+----------------------------+---------------------+
3232
| Debian 12 Bookworm | 3.11 | x86, x86-64 |
3333
+----------------------------------+----------------------------+---------------------+
34-
| Fedora 40 | 3.12 | x86-64 |
35-
+----------------------------------+----------------------------+---------------------+
3634
| Fedora 41 | 3.13 | x86-64 |
3735
+----------------------------------+----------------------------+---------------------+
36+
| Fedora 42 | 3.13 | x86-64 |
37+
+----------------------------------+----------------------------+---------------------+
3838
| Gentoo | 3.12 | x86-64 |
3939
+----------------------------------+----------------------------+---------------------+
4040
| macOS 13 Ventura | 3.9 | x86-64 |
@@ -73,7 +73,7 @@ These platforms have been reported to work at the versions mentioned.
7373
| Operating system | | Tested Python | | Latest tested | | Tested |
7474
| | | versions | | Pillow version | | processors |
7575
+==================================+============================+==================+==============+
76-
| macOS 15 Sequoia | 3.9, 3.10, 3.11, 3.12, 3.13| 11.1.0 |arm |
76+
| macOS 15 Sequoia | 3.9, 3.10, 3.11, 3.12, 3.13| 11.2.1 |arm |
7777
| +----------------------------+------------------+ |
7878
| | 3.8 | 10.4.0 | |
7979
+----------------------------------+----------------------------+------------------+--------------+

docs/reference/ImageDraw.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ Methods
391391
the relative alignment of lines. Use the ``anchor`` parameter to
392392
specify the alignment to ``xy``.
393393

394-
.. versionadded:: 11.2.0 ``"justify"``
394+
.. versionadded:: 11.2.1 ``"justify"``
395395
:param direction: Direction of the text. It can be ``"rtl"`` (right to
396396
left), ``"ltr"`` (left to right) or ``"ttb"`` (top to bottom).
397397
Requires libraqm.
@@ -462,7 +462,7 @@ Methods
462462
the relative alignment of lines. Use the ``anchor`` parameter to
463463
specify the alignment to ``xy``.
464464

465-
.. versionadded:: 11.2.0 ``"justify"``
465+
.. versionadded:: 11.2.1 ``"justify"``
466466
:param direction: Direction of the text. It can be ``"rtl"`` (right to
467467
left), ``"ltr"`` (left to right) or ``"ttb"`` (top to bottom).
468468
Requires libraqm.
@@ -609,7 +609,7 @@ Methods
609609
the relative alignment of lines. Use the ``anchor`` parameter to
610610
specify the alignment to ``xy``.
611611

612-
.. versionadded:: 11.2.0 ``"justify"``
612+
.. versionadded:: 11.2.1 ``"justify"``
613613
:param direction: Direction of the text. It can be ``"rtl"`` (right to
614614
left), ``"ltr"`` (left to right) or ``"ttb"`` (top to bottom).
615615
Requires libraqm.
@@ -663,7 +663,7 @@ Methods
663663
the relative alignment of lines. Use the ``anchor`` parameter to
664664
specify the alignment to ``xy``.
665665

666-
.. versionadded:: 11.2.0 ``"justify"``
666+
.. versionadded:: 11.2.1 ``"justify"``
667667
:param direction: Direction of the text. It can be ``"rtl"`` (right to
668668
left), ``"ltr"`` (left to right) or ``"ttb"`` (top to bottom).
669669
Requires libraqm.

docs/reference/ImageGrab.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ or the clipboard to a PIL image memory.
4444
:param window:
4545
HWND, to capture a single window. Windows only.
4646

47-
.. versionadded:: 11.2.0
47+
.. versionadded:: 11.2.1
4848
:return: An image
4949

5050
.. py:function:: grabclipboard()

docs/releasenotes/11.2.0.rst renamed to docs/releasenotes/11.2.1.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1-
11.2.0
1+
11.2.1
22
------
33

4+
.. warning::
5+
6+
The release of Pillow *11.2.0* was halted prematurely, due to hitting PyPI's
7+
project size limit and concern over the size of Pillow wheels containing libavif.
8+
The PyPI limit has now been increased and Pillow *11.2.1* has been released
9+
instead, without libavif included in the wheels.
10+
To avoid confusion, the incomplete 11.2.0 release has been removed from PyPI.
11+
412
Security
513
========
614

@@ -17,7 +25,7 @@ Deprecations
1725
Image.Image.get_child_images()
1826
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1927

20-
.. deprecated:: 11.2.0
28+
.. deprecated:: 11.2.1
2129

2230
``Image.Image.get_child_images()`` has been deprecated. and will be removed in Pillow
2331
13 (2026-10-15). It will be moved to ``ImageFile.ImageFile.get_child_images()``. The
@@ -106,5 +114,5 @@ Pillow images can also be converted to Arrow objects::
106114
Reading and writing AVIF images
107115
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
108116

109-
Pillow can now read and write AVIF images. If you are building Pillow from source, this
110-
will require libavif 1.0.0 or later.
117+
Pillow can now read and write AVIF images when built from source with libavif 1.0.0
118+
or later.

0 commit comments

Comments
 (0)