Skip to content

Commit 783acbc

Browse files
authored
chore: Update libavif to v1.2.1 (#73)
Update libavif to 1.2.1. The only library version change since 1.5.0 is SVT-AV1, which was upgraded from 3.0.0 to 3.0.1. Fixes the logged warning in #72. * Install cargo-c binary in windows wheel build job * Use rust-toolchain action to install on windows
1 parent d801060 commit 783acbc

File tree

6 files changed

+40
-9
lines changed

6 files changed

+40
-9
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
include:
2828
- python-version: "3.9"
2929
os: "ubuntu-22.04"
30-
libavif-version: "88d3dccda111f6ccbcccd925179f67e7d6fdf4ff"
30+
libavif-version: "1d469864478de5686a13c06b5539416ac68d98d7"
3131
- python-version: "3.7"
3232
PYTHONOPTIMIZE: 1
3333
- python-version: "3.8"

.github/workflows/wheels.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
MACOSX_DEPLOYMENT_TARGET: "10.10"
1111
WHEEL_SDIR: wheelhouse
1212
CONFIG_PATH: pillow-avif-plugin/wheelbuild/config.sh
13-
LIBAVIF_VERSION: 88d3dccda111f6ccbcccd925179f67e7d6fdf4ff
13+
LIBAVIF_VERSION: 1.2.1
1414

1515
concurrency:
1616
group: ${{ github.workflow }}-${{ github.ref }}
@@ -261,13 +261,19 @@ jobs:
261261
run: |
262262
python.exe -m pip install -r .ci/requirements-cibw.txt
263263
264+
- name: Install rust toolchain
265+
uses: dtolnay/rust-toolchain@stable
266+
264267
- name: Prepare for build
265268
run: |
266269
choco install nasm --no-progress
267270
echo "C:\Program Files\NASM" >> $env:GITHUB_PATH
268271
269272
python.exe -m pip install meson
270-
273+
274+
curl -LO "https://github.com/lu-zero/cargo-c/releases/latest/download/cargo-c-windows-msvc.zip"
275+
7z e -y "cargo-c-windows-msvc.zip" -o"${env:USERPROFILE}\.cargo\bin"
276+
271277
& python.exe winbuild\build_prepare.py -v --architecture=${{ matrix.cibw_arch }}
272278
shell: pwsh
273279

CHANGELOG.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
Changelog
22
=========
33

4+
Changes since 1.5.0 (unreleased)
5+
--------------------------------
6+
7+
* **CI**: Update libavif to 1.2.1. The only library version change since
8+
1.5.0 is SVT-AV1, which was upgraded from 3.0.0 to 3.0.1. See the table
9+
below for all AVIF codec versions in this release.
10+
11+
.. table::
12+
13+
=========== ==========
14+
**libavif** **1.2.1**
15+
libaom 3.12.0
16+
dav1d 1.5.1
17+
**SVT-AV1** **3.0.1**
18+
rav1e 0.7.1
19+
=========== ==========
20+
421
1.5.0 (Mar 7, 2025)
522
-------------------
623

depends/install_libavif.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ curl -sLo - \
3838
pushd libavif-$LIBAVIF_VERSION
3939
echo "::endgroup::"
4040

41-
if [ "$LIBAVIF_VERSION" == "1.0.1" ]; then
42-
patch -p1 < "${SCRIPT_DIR}/../wheelbuild/libavif-1.0.1-local-static.patch"
41+
if [ "$LIBAVIF_VERSION" != "0.11.0" ]; then
42+
LIBAVIF_CMAKE_FLAGS+=(-DAVIF_LIBYUV=LOCAL)
43+
HAS_EXT_DIR=
4344
fi
4445

4546
HAS_DECODER=0
@@ -77,8 +78,10 @@ if [ "$HAS_ENCODER" != 1 ] || [ "$HAS_DECODER" != 1 ]; then
7778
pushd ext > /dev/null
7879
bash aom.cmd
7980
popd > /dev/null
81+
LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_AOM=ON -DAVIF_LOCAL_AOM=ON)
82+
else
83+
LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_AOM=LOCAL)
8084
fi
81-
LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_AOM=ON -DAVIF_LOCAL_AOM=ON)
8285
echo "::endgroup::"
8386
fi
8487

wheelbuild/config.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -eo pipefail
44
CONFIG_DIR=$(abspath $(dirname "${BASH_SOURCE[0]}"))
55

66
ARCHIVE_SDIR=pillow-avif-plugin-depends
7-
LIBAVIF_VERSION=4eb0a40fb06612adf53650a14c692eaf62c068e6
7+
LIBAVIF_VERSION=1.2.1
88
RAV1E_VERSION=0.7.1
99
CCACHE_VERSION=4.10.2
1010
SCCACHE_VERSION=0.10.0
@@ -335,8 +335,13 @@ EOF
335335

336336
group_start "Download libavif source"
337337

338+
local libavif_archive="${LIBAVIF_VERSION}.tar.gz"
339+
if [[ "$LIBAVIF_VERSION" == *"."* ]]; then
340+
libavif_archive="v${libavif_archive}"
341+
fi
342+
338343
local out_dir=$(fetch_unpack \
339-
"https://github.com/AOMediaCodec/libavif/archive/$LIBAVIF_VERSION.tar.gz" \
344+
"https://github.com/AOMediaCodec/libavif/archive/$libavif_archive" \
340345
"libavif-$LIBAVIF_VERSION.tar.gz")
341346

342347
group_end

winbuild/build_prepare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def cmd_msbuild(
110110

111111
V = {
112112
"MESON": "1.5.1",
113-
"LIBAVIF": "1.2.0",
113+
"LIBAVIF": "1.2.1",
114114
}
115115

116116

0 commit comments

Comments
 (0)