Merge branch 'main' into chore/remove-rav1e

This commit is contained in:
Andrew Murray 2025-05-28 00:26:52 +10:00 committed by GitHub
commit 01daa3ddd5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 16 additions and 11 deletions

View File

@ -66,7 +66,7 @@ if [[ $(uname) != CYGWIN* ]]; then
pushd depends && ./install_raqm.sh && popd pushd depends && ./install_raqm.sh && popd
# libavif # libavif
pushd depends && CMAKE_POLICY_VERSION_MINIMUM=3.5 ./install_libavif.sh && popd pushd depends && ./install_libavif.sh && popd
# extra test images # extra test images
pushd depends && ./install_extra_test_images.sh && popd pushd depends && ./install_extra_test_images.sh && popd

View File

@ -39,7 +39,7 @@ ARCHIVE_SDIR=pillow-depends-main
# Package versions for fresh source builds # Package versions for fresh source builds
FREETYPE_VERSION=2.13.3 FREETYPE_VERSION=2.13.3
HARFBUZZ_VERSION=11.2.1 HARFBUZZ_VERSION=11.2.1
LIBPNG_VERSION=1.6.47 LIBPNG_VERSION=1.6.48
JPEGTURBO_VERSION=3.1.0 JPEGTURBO_VERSION=3.1.0
OPENJPEG_VERSION=2.5.3 OPENJPEG_VERSION=2.5.3
XZ_VERSION=5.8.1 XZ_VERSION=5.8.1

View File

@ -224,13 +224,14 @@ def _add_directory(
path.insert(where, subdir) path.insert(where, subdir)
def _find_include_file(self: pil_build_ext, include: str) -> int: def _find_include_file(self: pil_build_ext, include: str) -> str | None:
for directory in self.compiler.include_dirs: for directory in self.compiler.include_dirs:
_dbg("Checking for include file %s in %s", (include, directory)) _dbg("Checking for include file %s in %s", (include, directory))
if os.path.isfile(os.path.join(directory, include)): path = os.path.join(directory, include)
if os.path.isfile(path):
_dbg("Found %s", include) _dbg("Found %s", include)
return 1 return path
return 0 return None
def _find_library_file(self: pil_build_ext, library: str) -> str | None: def _find_library_file(self: pil_build_ext, library: str) -> str | None:
@ -852,9 +853,13 @@ class pil_build_ext(build_ext):
if feature.want("avif"): if feature.want("avif"):
_dbg("Looking for avif") _dbg("Looking for avif")
if _find_include_file(self, "avif/avif.h"): if avif_h := _find_include_file(self, "avif/avif.h"):
if _find_library_file(self, "avif"): with open(avif_h, "rb") as fp:
feature.set("avif", "avif") major_version = int(
fp.read().split(b"#define AVIF_VERSION_MAJOR ")[1].split()[0]
)
if major_version >= 1 and _find_library_file(self, "avif"):
feature.set("avif", "avif")
for f in feature: for f in feature:
if not feature.get(f) and feature.require(f): if not feature.get(f) and feature.require(f):

View File

@ -81,7 +81,7 @@ class WmfStubImageFile(ImageFile.StubImageFile):
def _open(self) -> None: def _open(self) -> None:
# check placable header # check placable header
s = self.fp.read(80) s = self.fp.read(44)
if s.startswith(b"\xd7\xcd\xc6\x9a\x00\x00"): if s.startswith(b"\xd7\xcd\xc6\x9a\x00\x00"):
# placeable windows metafile # placeable windows metafile

View File

@ -121,7 +121,7 @@ V = {
"LCMS2": "2.17", "LCMS2": "2.17",
"LIBAVIF": "1.3.0", "LIBAVIF": "1.3.0",
"LIBIMAGEQUANT": "4.3.4", "LIBIMAGEQUANT": "4.3.4",
"LIBPNG": "1.6.47", "LIBPNG": "1.6.48",
"LIBWEBP": "1.5.0", "LIBWEBP": "1.5.0",
"OPENJPEG": "2.5.3", "OPENJPEG": "2.5.3",
"TIFF": "4.7.0", "TIFF": "4.7.0",