mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-29 01:20:05 +03:00
Merge branch 'main' into chore/remove-rav1e
This commit is contained in:
commit
01daa3ddd5
|
@ -66,7 +66,7 @@ if [[ $(uname) != CYGWIN* ]]; then
|
|||
pushd depends && ./install_raqm.sh && popd
|
||||
|
||||
# libavif
|
||||
pushd depends && CMAKE_POLICY_VERSION_MINIMUM=3.5 ./install_libavif.sh && popd
|
||||
pushd depends && ./install_libavif.sh && popd
|
||||
|
||||
# extra test images
|
||||
pushd depends && ./install_extra_test_images.sh && popd
|
||||
|
|
2
.github/workflows/wheels-dependencies.sh
vendored
2
.github/workflows/wheels-dependencies.sh
vendored
|
@ -39,7 +39,7 @@ ARCHIVE_SDIR=pillow-depends-main
|
|||
# Package versions for fresh source builds
|
||||
FREETYPE_VERSION=2.13.3
|
||||
HARFBUZZ_VERSION=11.2.1
|
||||
LIBPNG_VERSION=1.6.47
|
||||
LIBPNG_VERSION=1.6.48
|
||||
JPEGTURBO_VERSION=3.1.0
|
||||
OPENJPEG_VERSION=2.5.3
|
||||
XZ_VERSION=5.8.1
|
||||
|
|
19
setup.py
19
setup.py
|
@ -224,13 +224,14 @@ def _add_directory(
|
|||
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:
|
||||
_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)
|
||||
return 1
|
||||
return 0
|
||||
return path
|
||||
return 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"):
|
||||
_dbg("Looking for avif")
|
||||
if _find_include_file(self, "avif/avif.h"):
|
||||
if _find_library_file(self, "avif"):
|
||||
feature.set("avif", "avif")
|
||||
if avif_h := _find_include_file(self, "avif/avif.h"):
|
||||
with open(avif_h, "rb") as fp:
|
||||
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:
|
||||
if not feature.get(f) and feature.require(f):
|
||||
|
|
|
@ -81,7 +81,7 @@ class WmfStubImageFile(ImageFile.StubImageFile):
|
|||
|
||||
def _open(self) -> None:
|
||||
# check placable header
|
||||
s = self.fp.read(80)
|
||||
s = self.fp.read(44)
|
||||
|
||||
if s.startswith(b"\xd7\xcd\xc6\x9a\x00\x00"):
|
||||
# placeable windows metafile
|
||||
|
|
|
@ -121,7 +121,7 @@ V = {
|
|||
"LCMS2": "2.17",
|
||||
"LIBAVIF": "1.3.0",
|
||||
"LIBIMAGEQUANT": "4.3.4",
|
||||
"LIBPNG": "1.6.47",
|
||||
"LIBPNG": "1.6.48",
|
||||
"LIBWEBP": "1.5.0",
|
||||
"OPENJPEG": "2.5.3",
|
||||
"TIFF": "4.7.0",
|
||||
|
|
Loading…
Reference in New Issue
Block a user