mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-10 16:22:22 +03:00
Merge branch 'main' into debug-build
This commit is contained in:
commit
b416330530
4
.github/workflows/test-windows.yml
vendored
4
.github/workflows/test-windows.yml
vendored
|
@ -98,8 +98,8 @@ jobs:
|
||||||
choco install nasm --no-progress
|
choco install nasm --no-progress
|
||||||
echo "C:\Program Files\NASM" >> $env:GITHUB_PATH
|
echo "C:\Program Files\NASM" >> $env:GITHUB_PATH
|
||||||
|
|
||||||
choco install ghostscript --version=10.5.0 --no-progress
|
choco install ghostscript --version=10.5.1 --no-progress
|
||||||
echo "C:\Program Files\gs\gs10.05.0\bin" >> $env:GITHUB_PATH
|
echo "C:\Program Files\gs\gs10.05.1\bin" >> $env:GITHUB_PATH
|
||||||
|
|
||||||
# Install extra test images
|
# Install extra test images
|
||||||
xcopy /S /Y Tests\test-images\* Tests\images
|
xcopy /S /Y Tests\test-images\* Tests\images
|
||||||
|
|
4
.github/workflows/wheels-dependencies.sh
vendored
4
.github/workflows/wheels-dependencies.sh
vendored
|
@ -38,8 +38,8 @@ 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.1.0
|
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
|
||||||
|
|
|
@ -233,7 +233,7 @@ class TestFileAvif:
|
||||||
with Image.open(out_gif) as reread:
|
with Image.open(out_gif) as reread:
|
||||||
reread_value = reread.convert("RGB").getpixel((1, 1))
|
reread_value = reread.convert("RGB").getpixel((1, 1))
|
||||||
difference = sum([abs(original_value[i] - reread_value[i]) for i in range(3)])
|
difference = sum([abs(original_value[i] - reread_value[i]) for i in range(3)])
|
||||||
assert difference <= 3
|
assert difference <= 6
|
||||||
|
|
||||||
def test_save_single_frame(self, tmp_path: Path) -> None:
|
def test_save_single_frame(self, tmp_path: Path) -> None:
|
||||||
temp_file = tmp_path / "temp.avif"
|
temp_file = tmp_path / "temp.avif"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
version=1.2.1
|
version=1.3.0
|
||||||
|
|
||||||
./download-and-extract.sh libavif-$version https://github.com/AOMediaCodec/libavif/archive/refs/tags/v$version.tar.gz
|
./download-and-extract.sh libavif-$version https://github.com/AOMediaCodec/libavif/archive/refs/tags/v$version.tar.gz
|
||||||
|
|
||||||
|
|
22
setup.py
22
setup.py
|
@ -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:
|
||||||
|
@ -871,10 +872,15 @@ 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"):
|
||||||
lib_avif = _find_library_file(self, "avif")
|
with open(avif_h, "rb") as fp:
|
||||||
if lib_avif is not None:
|
major_version = int(
|
||||||
feature.set("avif", lib_avif)
|
fp.read().split(b"#define AVIF_VERSION_MAJOR ")[1].split()[0]
|
||||||
|
)
|
||||||
|
if major_version >= 1:
|
||||||
|
lib_avif = _find_library_file(self, "avif")
|
||||||
|
if lib_avif is not None:
|
||||||
|
feature.set("avif", lib_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):
|
||||||
|
|
|
@ -113,12 +113,12 @@ V = {
|
||||||
"BROTLI": "1.1.0",
|
"BROTLI": "1.1.0",
|
||||||
"FREETYPE": "2.13.3",
|
"FREETYPE": "2.13.3",
|
||||||
"FRIBIDI": "1.0.16",
|
"FRIBIDI": "1.0.16",
|
||||||
"HARFBUZZ": "11.1.0",
|
"HARFBUZZ": "11.2.1",
|
||||||
"JPEGTURBO": "3.1.0",
|
"JPEGTURBO": "3.1.0",
|
||||||
"LCMS2": "2.17",
|
"LCMS2": "2.17",
|
||||||
"LIBAVIF": "1.2.1",
|
"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",
|
||||||
|
@ -389,6 +389,7 @@ DEPS: dict[str, dict[str, Any]] = {
|
||||||
"filename": f"libavif-{V['LIBAVIF']}.zip",
|
"filename": f"libavif-{V['LIBAVIF']}.zip",
|
||||||
"license": "LICENSE",
|
"license": "LICENSE",
|
||||||
"build": [
|
"build": [
|
||||||
|
"rustup update",
|
||||||
f"{sys.executable} -m pip install meson",
|
f"{sys.executable} -m pip install meson",
|
||||||
*cmds_cmake(
|
*cmds_cmake(
|
||||||
"avif_static",
|
"avif_static",
|
||||||
|
@ -399,7 +400,6 @@ DEPS: dict[str, dict[str, Any]] = {
|
||||||
"-DAVIF_CODEC_DAV1D=LOCAL",
|
"-DAVIF_CODEC_DAV1D=LOCAL",
|
||||||
"-DAVIF_CODEC_RAV1E=LOCAL",
|
"-DAVIF_CODEC_RAV1E=LOCAL",
|
||||||
"-DAVIF_CODEC_SVT=LOCAL",
|
"-DAVIF_CODEC_SVT=LOCAL",
|
||||||
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5",
|
|
||||||
),
|
),
|
||||||
cmd_xcopy("include", "{inc_dir}"),
|
cmd_xcopy("include", "{inc_dir}"),
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user