Skip to content

Commit 8f90f78

Browse files
committed
Merge branch 'main' into load_default_imagefont
2 parents 930c423 + 920698e commit 8f90f78

File tree

140 files changed

+1913
-1165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+1913
-1165
lines changed

.appveyor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ install:
3232
- curl -fsSL -o pillow-test-images.zip https://github.com/python-pillow/test-images/archive/main.zip
3333
- 7z x pillow-test-images.zip -oc:\
3434
- xcopy /S /Y c:\test-images-main\* c:\pillow\tests\images
35-
- curl -fsSL -o nasm-win64.zip https://raw.githubusercontent.com/python-pillow/pillow-depends/main/nasm-2.16.01-win64.zip
35+
- curl -fsSL -o nasm-win64.zip https://raw.githubusercontent.com/python-pillow/pillow-depends/main/nasm-2.16.03-win64.zip
3636
- 7z x nasm-win64.zip -oc:\
37-
- choco install ghostscript --version=10.3.0
38-
- path c:\nasm-2.16.01;C:\Program Files\gs\gs10.00.0\bin;%PATH%
37+
- choco install ghostscript --version=10.3.1
38+
- path c:\nasm-2.16.03;C:\Program Files\gs\gs10.03.1\bin;%PATH%
3939
- cd c:\pillow\winbuild\
4040
- ps: |
4141
c:\python38\python.exe c:\pillow\winbuild\build_prepare.py -v --depends=C:\pillow-depends\

.ci/requirements-cibw.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cibuildwheel==2.18.1
1+
cibuildwheel==2.19.1

.github/workflows/macos-install.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ brew install \
77
ghostscript \
88
libimagequant \
99
libjpeg \
10-
libraqm \
1110
libtiff \
1211
little-cms2 \
1312
openjpeg \
1413
webp
14+
if [[ "$ImageOS" == "macos13" ]]; then
15+
brew install --ignore-dependencies libraqm
16+
else
17+
brew install libraqm
18+
fi
1519
export PKG_CONFIG_PATH="/usr/local/opt/openblas/lib/pkgconfig"
1620

1721
# TODO Update condition when cffi supports 3.13

.github/workflows/test-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
choco install nasm --no-progress
8787
echo "C:\Program Files\NASM" >> $env:GITHUB_PATH
8888
89-
choco install ghostscript --version=10.3.0 --no-progress
89+
choco install ghostscript --version=10.3.1 --no-progress
9090
echo "C:\Program Files\gs\gs10.00.0\bin" >> $env:GITHUB_PATH
9191
9292
# Install extra test images

.github/workflows/wheels-dependencies.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ ARCHIVE_SDIR=pillow-depends-main
1616

1717
# Package versions for fresh source builds
1818
FREETYPE_VERSION=2.13.2
19-
HARFBUZZ_VERSION=8.4.0
19+
HARFBUZZ_VERSION=8.5.0
2020
LIBPNG_VERSION=1.6.43
21-
JPEGTURBO_VERSION=3.0.2
21+
JPEGTURBO_VERSION=3.0.3
2222
OPENJPEG_VERSION=2.5.2
2323
XZ_VERSION=5.4.5
2424
TIFF_VERSION=4.6.0
@@ -33,9 +33,9 @@ if [[ -n "$IS_MACOS" ]] || [[ "$MB_ML_VER" != 2014 ]]; then
3333
else
3434
ZLIB_VERSION=1.2.8
3535
fi
36-
LIBWEBP_VERSION=1.3.2
36+
LIBWEBP_VERSION=1.4.0
3737
BZIP2_VERSION=1.0.8
38-
LIBXCB_VERSION=1.16.1
38+
LIBXCB_VERSION=1.17.0
3939
BROTLI_VERSION=1.1.0
4040

4141
if [[ -n "$IS_MACOS" ]] && [[ "$CIBW_ARCHS" == "x86_64" ]]; then
@@ -70,7 +70,7 @@ function build {
7070
fi
7171
build_new_zlib
7272

73-
build_simple xcb-proto 1.16.0 https://xorg.freedesktop.org/archive/individual/proto
73+
build_simple xcb-proto 1.17.0 https://xorg.freedesktop.org/archive/individual/proto
7474
if [ -n "$IS_MACOS" ]; then
7575
build_simple xorgproto 2024.1 https://www.x.org/pub/individual/proto
7676
build_simple libXau 1.0.11 https://www.x.org/pub/individual/lib

.pre-commit-config.yaml

Lines changed: 4 additions & 4 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.4.3
3+
rev: v0.4.7
44
hooks:
55
- id: ruff
66
args: [--exit-non-zero-on-fix]
@@ -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: v18.1.4
27+
rev: v18.1.5
2828
hooks:
2929
- id: clang-format
3030
types: [c]
@@ -50,7 +50,7 @@ repos:
5050
exclude: ^.github/.*TEMPLATE|^Tests/(fonts|images)/
5151

5252
- repo: https://github.com/python-jsonschema/check-jsonschema
53-
rev: 0.28.2
53+
rev: 0.28.4
5454
hooks:
5555
- id: check-github-workflows
5656
- id: check-readthedocs
@@ -67,7 +67,7 @@ repos:
6767
- id: pyproject-fmt
6868

6969
- repo: https://github.com/abravalheri/validate-pyproject
70-
rev: v0.16
70+
rev: v0.18
7171
hooks:
7272
- id: validate-pyproject
7373

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
formats: [pdf]
44

55
build:
6-
os: ubuntu-22.04
6+
os: ubuntu-lts-latest
77
tools:
88
python: "3"
99
jobs:

CHANGES.rst

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

8+
- Support unpacking more rawmodes to RGBA palettes #7966
9+
[radarhere]
10+
11+
- Removed support for Qt 5 #8159
12+
[radarhere]
13+
14+
- Improve ``ImageFont.freetype`` support for XDG directories on Linux #8135
15+
[mamg22, radarhere]
16+
17+
- Improved consistency of XMP handling #8069
18+
[radarhere]
19+
20+
- Use pkg-config to help find libwebp and raqm #8142
21+
[radarhere]
22+
23+
- Accept 't' suffix for libtiff version #8126, #8129
24+
[radarhere]
25+
26+
- Deprecate ImageDraw.getdraw hints parameter #8124
27+
[radarhere, hugovk]
28+
29+
- Added ImageDraw circle() #8085
30+
[void4, hugovk, radarhere]
31+
832
- Add mypy target to Makefile #8077
933
[Yay295]
1034

Tests/bench_cffi_access.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def test_direct() -> None:
4444
caccess = im.im.pixel_access(False)
4545
access = PyAccess.new(im, False)
4646

47+
assert access is not None
4748
assert caccess[(0, 0)] == access[(0, 0)]
4849

4950
print(f"Size: {im.width}x{im.height}")

Tests/helper.py

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import pytest
1919
from packaging.version import parse as parse_version
2020

21-
from PIL import Image, ImageMath, features
21+
from PIL import Image, ImageFile, ImageMath, features
2222

2323
logger = logging.getLogger(__name__)
2424

@@ -174,12 +174,13 @@ def skip_unless_feature(feature: str) -> pytest.MarkDecorator:
174174
def skip_unless_feature_version(
175175
feature: str, required: str, reason: str | None = None
176176
) -> pytest.MarkDecorator:
177-
if not features.check(feature):
177+
version = features.version(feature)
178+
if version is None:
178179
return pytest.mark.skip(f"{feature} not available")
179180
if reason is None:
180181
reason = f"{feature} is older than {required}"
181182
version_required = parse_version(required)
182-
version_available = parse_version(features.version(feature))
183+
version_available = parse_version(version)
183184
return pytest.mark.skipif(version_available < version_required, reason=reason)
184185

185186

@@ -189,12 +190,13 @@ def mark_if_feature_version(
189190
version_blacklist: str,
190191
reason: str | None = None,
191192
) -> pytest.MarkDecorator:
192-
if not features.check(feature):
193+
version = features.version(feature)
194+
if version is None:
193195
return pytest.mark.pil_noop_mark()
194196
if reason is None:
195197
reason = f"{feature} is {version_blacklist}"
196198
version_required = parse_version(version_blacklist)
197-
version_available = parse_version(features.version(feature))
199+
version_available = parse_version(version)
198200
if (
199201
version_available.major == version_required.major
200202
and version_available.minor == version_required.minor
@@ -220,16 +222,11 @@ def _get_mem_usage(self) -> float:
220222
from resource import RUSAGE_SELF, getrusage
221223

222224
mem = getrusage(RUSAGE_SELF).ru_maxrss
223-
if sys.platform == "darwin":
224-
# man 2 getrusage:
225-
# ru_maxrss
226-
# This is the maximum resident set size utilized (in bytes).
227-
return mem / 1024 # Kb
228-
# linux
229-
# man 2 getrusage
230-
# ru_maxrss (since Linux 2.6.32)
231-
# This is the maximum resident set size used (in kilobytes).
232-
return mem # Kb
225+
# man 2 getrusage:
226+
# ru_maxrss
227+
# This is the maximum resident set size utilized
228+
# in bytes on macOS, in kilobytes on Linux
229+
return mem / 1024 if sys.platform == "darwin" else mem
233230

234231
def _test_leak(self, core: Callable[[], None]) -> None:
235232
start_mem = self._get_mem_usage()
@@ -243,7 +240,7 @@ def _test_leak(self, core: Callable[[], None]) -> None:
243240
# helpers
244241

245242

246-
def fromstring(data: bytes) -> Image.Image:
243+
def fromstring(data: bytes) -> ImageFile.ImageFile:
247244
return Image.open(BytesIO(data))
248245

249246

0 commit comments

Comments
 (0)