From f20ce67d56fd6d3860ac3c709c8c0d17d492fec4 Mon Sep 17 00:00:00 2001 From: Frankie Dintino Date: Mon, 12 May 2025 10:01:43 -0400 Subject: [PATCH] bump libavif to 1.3.0 --- .github/workflows/wheels-dependencies.sh | 13 ++++--------- Tests/test_file_avif.py | 2 +- winbuild/build_prepare.py | 3 +-- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/wheels-dependencies.sh b/.github/workflows/wheels-dependencies.sh index 6bd9e1eaf..bc8a0bb9e 100755 --- a/.github/workflows/wheels-dependencies.sh +++ b/.github/workflows/wheels-dependencies.sh @@ -51,7 +51,7 @@ LIBWEBP_VERSION=1.5.0 BZIP2_VERSION=1.0.8 LIBXCB_VERSION=1.17.0 BROTLI_VERSION=1.1.0 -LIBAVIF_VERSION=1.2.1 +LIBAVIF_VERSION=1.3.0 function build_pkg_config { if [ -e pkg-config-stamp ]; then return; fi @@ -128,14 +128,10 @@ function build_libavif { fi local out_dir=$(fetch_unpack https://github.com/AOMediaCodec/libavif/archive/refs/tags/v$LIBAVIF_VERSION.tar.gz libavif-$LIBAVIF_VERSION.tar.gz) - # CONFIG_AV1_DECODER=0 is a flag for libaom (included as a subproject of - # libavif) to disable the compilation and inclusion of aom's AV1 decoder. - # CONFIG_AV1_HIGHBITDEPTH=0 is another flag for libaom that disables support - # for encoding high bit depth images. - # CMAKE_POLICY_VERSION_MINIMUM=3.9 enables cmake policy CMP0069, which is - # required to allow INTERPROCEDURAL_OPTIMIZATION (-flto) WITH gcc + # CONFIG_AV1_HIGHBITDEPTH=0 is a flag for libaom (included as a subproject + # of libavif) that disables support for encoding high bit depth images. (cd $out_dir \ - && CMAKE_POLICY_VERSION_MINIMUM=3.9 cmake \ + && cmake \ -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX \ -DCMAKE_INSTALL_LIBDIR=$BUILD_PREFIX/lib \ -DCMAKE_INSTALL_NAME_DIR=$BUILD_PREFIX/lib \ @@ -143,7 +139,6 @@ function build_libavif { -DAVIF_LIBSHARPYUV=LOCAL \ -DAVIF_LIBYUV=LOCAL \ -DAVIF_CODEC_AOM=LOCAL \ - -DCONFIG_AV1_DECODER=0 \ -DCONFIG_AV1_HIGHBITDEPTH=0 \ -DAVIF_CODEC_AOM_DECODE=OFF \ -DAVIF_CODEC_DAV1D=LOCAL \ diff --git a/Tests/test_file_avif.py b/Tests/test_file_avif.py index bd87947c0..b2e586637 100644 --- a/Tests/test_file_avif.py +++ b/Tests/test_file_avif.py @@ -233,7 +233,7 @@ class TestFileAvif: with Image.open(out_gif) as reread: reread_value = reread.convert("RGB").getpixel((1, 1)) 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: temp_file = tmp_path / "temp.avif" diff --git a/winbuild/build_prepare.py b/winbuild/build_prepare.py index a732cc63a..229fe74a6 100644 --- a/winbuild/build_prepare.py +++ b/winbuild/build_prepare.py @@ -119,7 +119,7 @@ V = { "HARFBUZZ": "11.1.0", "JPEGTURBO": "3.1.0", "LCMS2": "2.17", - "LIBAVIF": "1.2.1", + "LIBAVIF": "1.3.0", "LIBIMAGEQUANT": "4.3.4", "LIBPNG": "1.6.47", "LIBWEBP": "1.5.0", @@ -399,7 +399,6 @@ DEPS: dict[str, dict[str, Any]] = { "-DAVIF_LIBSHARPYUV=LOCAL", "-DAVIF_LIBYUV=LOCAL", "-DAVIF_CODEC_AOM=LOCAL", - "-DCONFIG_AV1_DECODER=0", "-DCONFIG_AV1_HIGHBITDEPTH=0", "-DAVIF_CODEC_AOM_DECODE=OFF", "-DAVIF_CODEC_DAV1D=LOCAL",