Skip to content

Commit 01daa3d

Browse files
authored
Merge branch 'main' into chore/remove-rav1e
2 parents a3cba6a + 06e618c commit 01daa3d

5 files changed

Lines changed: 16 additions & 11 deletions

File tree

.ci/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if [[ $(uname) != CYGWIN* ]]; then
6666
pushd depends && ./install_raqm.sh && popd
6767

6868
# libavif
69-
pushd depends && CMAKE_POLICY_VERSION_MINIMUM=3.5 ./install_libavif.sh && popd
69+
pushd depends && ./install_libavif.sh && popd
7070

7171
# extra test images
7272
pushd depends && ./install_extra_test_images.sh && popd

.github/workflows/wheels-dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ ARCHIVE_SDIR=pillow-depends-main
3939
# Package versions for fresh source builds
4040
FREETYPE_VERSION=2.13.3
4141
HARFBUZZ_VERSION=11.2.1
42-
LIBPNG_VERSION=1.6.47
42+
LIBPNG_VERSION=1.6.48
4343
JPEGTURBO_VERSION=3.1.0
4444
OPENJPEG_VERSION=2.5.3
4545
XZ_VERSION=5.8.1

setup.py

Lines changed: 12 additions & 7 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:
@@ -852,9 +853,13 @@ def build_extensions(self) -> None:
852853

853854
if feature.want("avif"):
854855
_dbg("Looking for avif")
855-
if _find_include_file(self, "avif/avif.h"):
856-
if _find_library_file(self, "avif"):
857-
feature.set("avif", "avif")
856+
if avif_h := _find_include_file(self, "avif/avif.h"):
857+
with open(avif_h, "rb") as fp:
858+
major_version = int(
859+
fp.read().split(b"#define AVIF_VERSION_MAJOR ")[1].split()[0]
860+
)
861+
if major_version >= 1 and _find_library_file(self, "avif"):
862+
feature.set("avif", "avif")
858863

859864
for f in feature:
860865
if not feature.get(f) and feature.require(f):

src/PIL/WmfImagePlugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class WmfStubImageFile(ImageFile.StubImageFile):
8181

8282
def _open(self) -> None:
8383
# check placable header
84-
s = self.fp.read(80)
84+
s = self.fp.read(44)
8585

8686
if s.startswith(b"\xd7\xcd\xc6\x9a\x00\x00"):
8787
# placeable windows metafile

winbuild/build_prepare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def cmd_msbuild(
121121
"LCMS2": "2.17",
122122
"LIBAVIF": "1.3.0",
123123
"LIBIMAGEQUANT": "4.3.4",
124-
"LIBPNG": "1.6.47",
124+
"LIBPNG": "1.6.48",
125125
"LIBWEBP": "1.5.0",
126126
"OPENJPEG": "2.5.3",
127127
"TIFF": "4.7.0",

0 commit comments

Comments
 (0)