Skip to content

Commit

Permalink
Sort AVIF codecs alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Feb 1, 2025
1 parent 6b2e736 commit 1eaaa43
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ brew install \
little-cms2 \
openjpeg \
webp \
dav1d \
aom \
dav1d \
rav1e \
svt-av1
if [[ "$ImageOS" == "macos13" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheels-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ function build_libavif {
-DBUILD_SHARED_LIBS=OFF \
-DAVIF_LIBSHARPYUV=LOCAL \
-DAVIF_LIBYUV=LOCAL \
-DAVIF_CODEC_RAV1E=LOCAL \
-DAVIF_CODEC_AOM=LOCAL \
-DAVIF_CODEC_DAV1D=LOCAL \
-DAVIF_CODEC_RAV1E=LOCAL \
-DAVIF_CODEC_SVT=LOCAL \
-DENABLE_NASM=ON \
-DCMAKE_MODULE_PATH=/tmp/cmake/Modules \
Expand Down
22 changes: 11 additions & 11 deletions depends/install_libavif.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,22 @@ LIBAVIF_CMAKE_FLAGS=()
HAS_DECODER=0
HAS_ENCODER=0

if $PKGCONFIG --exists aom; then
LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_AOM=SYSTEM)
HAS_ENCODER=1
HAS_DECODER=1
fi

if $PKGCONFIG --exists dav1d; then
LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_DAV1D=SYSTEM)
HAS_DECODER=1
fi

if $PKGCONFIG --exists libgav1; then
LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_LIBGAV1=SYSTEM)
HAS_DECODER=1
fi

if $PKGCONFIG --exists rav1e; then
LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_RAV1E=SYSTEM)
HAS_ENCODER=1
Expand All @@ -34,17 +45,6 @@ if $PKGCONFIG --exists SvtAv1Enc; then
HAS_ENCODER=1
fi

if $PKGCONFIG --exists libgav1; then
LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_LIBGAV1=SYSTEM)
HAS_DECODER=1
fi

if $PKGCONFIG --exists aom; then
LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_AOM=SYSTEM)
HAS_ENCODER=1
HAS_DECODER=1
fi

if [ "$HAS_ENCODER" != 1 ] || [ "$HAS_DECODER" != 1 ]; then
LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_AOM=LOCAL)
fi
Expand Down
1 change: 0 additions & 1 deletion docs/installation/building-from-source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ Many of Pillow's features require external libraries:

* **libxcb** provides X11 screengrab support.


* **libavif** provides support for the AVIF format.

* Pillow requires libavif version **0.8.0** or greater, which is when
Expand Down
2 changes: 1 addition & 1 deletion winbuild/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ Run ``build_prepare.py`` to configure the build::
build architecture (default: same as host Python)
--nmake build dependencies using NMake instead of Ninja
--no-imagequant skip GPL-licensed optional dependency libimagequant
--no-avif skip optional dependency libavif
--no-fribidi, --no-raqm
skip LGPL-licensed optional dependency FriBiDi
--no-avif skip optional dependency libavif

Arguments can also be supplied using the environment variables PILLOW_BUILD,
PILLOW_DEPS, ARCHITECTURE. See winbuild\build.rst for more information.
Expand Down
6 changes: 3 additions & 3 deletions winbuild/build_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,11 @@ def cmd_msbuild(
*cmds_cmake(
"avif_static",
"-DBUILD_SHARED_LIBS=OFF",
"-DAVIF_CODEC_AOM=LOCAL",
"-DAVIF_LIBYUV=LOCAL",
"-DAVIF_LIBSHARPYUV=LOCAL",
"-DAVIF_CODEC_RAV1E=LOCAL",
"-DAVIF_LIBYUV=LOCAL",
"-DAVIF_CODEC_AOM=LOCAL",
"-DAVIF_CODEC_DAV1D=LOCAL",
"-DAVIF_CODEC_RAV1E=LOCAL",
"-DAVIF_CODEC_SVT=LOCAL",
),
cmd_xcopy("include", "{inc_dir}"),
Expand Down

0 comments on commit 1eaaa43

Please sign in to comment.