Skip to content

Commit b416330

Browse files
committed
Merge branch 'main' into debug-build
2 parents 73d01c1 + 086e05f commit b416330

File tree

6 files changed

+24
-18
lines changed

6 files changed

+24
-18
lines changed

.github/workflows/test-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ jobs:
9898
choco install nasm --no-progress
9999
echo "C:\Program Files\NASM" >> $env:GITHUB_PATH
100100
101-
choco install ghostscript --version=10.5.0 --no-progress
102-
echo "C:\Program Files\gs\gs10.05.0\bin" >> $env:GITHUB_PATH
101+
choco install ghostscript --version=10.5.1 --no-progress
102+
echo "C:\Program Files\gs\gs10.05.1\bin" >> $env:GITHUB_PATH
103103
104104
# Install extra test images
105105
xcopy /S /Y Tests\test-images\* Tests\images

.github/workflows/wheels-dependencies.sh

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

3939
# Package versions for fresh source builds
4040
FREETYPE_VERSION=2.13.3
41-
HARFBUZZ_VERSION=11.1.0
42-
LIBPNG_VERSION=1.6.47
41+
HARFBUZZ_VERSION=11.2.1
42+
LIBPNG_VERSION=1.6.48
4343
JPEGTURBO_VERSION=3.1.0
4444
OPENJPEG_VERSION=2.5.3
4545
XZ_VERSION=5.8.1

Tests/test_file_avif.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def test_background_from_gif(self, tmp_path: Path) -> None:
233233
with Image.open(out_gif) as reread:
234234
reread_value = reread.convert("RGB").getpixel((1, 1))
235235
difference = sum([abs(original_value[i] - reread_value[i]) for i in range(3)])
236-
assert difference <= 3
236+
assert difference <= 6
237237

238238
def test_save_single_frame(self, tmp_path: Path) -> None:
239239
temp_file = tmp_path / "temp.avif"

depends/install_libavif.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -eo pipefail
33

4-
version=1.2.1
4+
version=1.3.0
55

66
./download-and-extract.sh libavif-$version https://github.com/AOMediaCodec/libavif/archive/refs/tags/v$version.tar.gz
77

setup.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,14 @@ def _add_directory(
224224
path.insert(where, subdir)
225225

226226

227-
def _find_include_file(self: pil_build_ext, include: str) -> int:
227+
def _find_include_file(self: pil_build_ext, include: str) -> str | None:
228228
for directory in self.compiler.include_dirs:
229229
_dbg("Checking for include file %s in %s", (include, directory))
230-
if os.path.isfile(os.path.join(directory, include)):
230+
path = os.path.join(directory, include)
231+
if os.path.isfile(path):
231232
_dbg("Found %s", include)
232-
return 1
233-
return 0
233+
return path
234+
return None
234235

235236

236237
def _find_library_file(self: pil_build_ext, library: str) -> str | None:
@@ -871,10 +872,15 @@ def build_extensions(self) -> None:
871872

872873
if feature.want("avif"):
873874
_dbg("Looking for avif")
874-
if _find_include_file(self, "avif/avif.h"):
875-
lib_avif = _find_library_file(self, "avif")
876-
if lib_avif is not None:
877-
feature.set("avif", lib_avif)
875+
if avif_h := _find_include_file(self, "avif/avif.h"):
876+
with open(avif_h, "rb") as fp:
877+
major_version = int(
878+
fp.read().split(b"#define AVIF_VERSION_MAJOR ")[1].split()[0]
879+
)
880+
if major_version >= 1:
881+
lib_avif = _find_library_file(self, "avif")
882+
if lib_avif is not None:
883+
feature.set("avif", lib_avif)
878884

879885
for f in feature:
880886
if not feature.get(f) and feature.require(f):

winbuild/build_prepare.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ def cmd_msbuild(
113113
"BROTLI": "1.1.0",
114114
"FREETYPE": "2.13.3",
115115
"FRIBIDI": "1.0.16",
116-
"HARFBUZZ": "11.1.0",
116+
"HARFBUZZ": "11.2.1",
117117
"JPEGTURBO": "3.1.0",
118118
"LCMS2": "2.17",
119-
"LIBAVIF": "1.2.1",
119+
"LIBAVIF": "1.3.0",
120120
"LIBIMAGEQUANT": "4.3.4",
121-
"LIBPNG": "1.6.47",
121+
"LIBPNG": "1.6.48",
122122
"LIBWEBP": "1.5.0",
123123
"OPENJPEG": "2.5.3",
124124
"TIFF": "4.7.0",
@@ -389,6 +389,7 @@ def cmd_msbuild(
389389
"filename": f"libavif-{V['LIBAVIF']}.zip",
390390
"license": "LICENSE",
391391
"build": [
392+
"rustup update",
392393
f"{sys.executable} -m pip install meson",
393394
*cmds_cmake(
394395
"avif_static",
@@ -399,7 +400,6 @@ def cmd_msbuild(
399400
"-DAVIF_CODEC_DAV1D=LOCAL",
400401
"-DAVIF_CODEC_RAV1E=LOCAL",
401402
"-DAVIF_CODEC_SVT=LOCAL",
402-
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5",
403403
),
404404
cmd_xcopy("include", "{inc_dir}"),
405405
],

0 commit comments

Comments
 (0)