Include in Windows x86 wheels (#38)

* Added release notes

* Simplified code

* AVIF works on Windows x86

---------

Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
This commit is contained in:
Andrew Murray 2025-06-21 01:13:55 +10:00 committed by GitHub
parent 7607474b42
commit 22222373f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 7 deletions

View File

@ -111,11 +111,11 @@ function build_libavif {
local build_type=MinSizeRel
local lto=ON
local libavif_cmake_flags=()
local libavif_cmake_flags
if [ -n "$IS_MACOS" ]; then
lto=OFF
libavif_cmake_flags+=(
libavif_cmake_flags=(
-DCMAKE_C_FLAGS_MINSIZEREL="-Oz -DNDEBUG -flto " \
-DCMAKE_CXX_FLAGS_MINSIZEREL="-Oz -DNDEBUG -flto" \
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-Wl,-S,-x,-dead_strip_dylibs" \
@ -124,7 +124,7 @@ function build_libavif {
if [[ "$MB_ML_VER" == 2014 ]] && [[ "$PLAT" == "x86_64" ]]; then
build_type=Release
fi
libavif_cmake_flags+=(-DCMAKE_SHARED_LINKER_FLAGS_INIT="-Wl,--strip-all,-z,relro,-z,now")
libavif_cmake_flags=(-DCMAKE_SHARED_LINKER_FLAGS_INIT="-Wl,--strip-all,-z,relro,-z,now")
fi
local out_dir=$(fetch_unpack https://github.com/AOMediaCodec/libavif/archive/refs/tags/v$LIBAVIF_VERSION.tar.gz libavif-$LIBAVIF_VERSION.tar.gz)

View File

@ -1,7 +1,6 @@
from __future__ import annotations
import platform
import struct
import sys
from PIL import features
@ -21,8 +20,8 @@ def test_wheel_modules() -> None:
except ImportError:
expected_modules.remove("tkinter")
# libavif is not available on Windows for x86 and ARM64 architectures
if platform.machine() == "ARM64" or struct.calcsize("P") == 4:
# libavif is not available on Windows for ARM64 architectures
if platform.machine() == "ARM64":
expected_modules.remove("avif")
assert set(features.get_supported_modules()) == expected_modules

View File

@ -47,6 +47,12 @@ TODO
Other changes
=============
AVIF support in wheels
^^^^^^^^^^^^^^^^^^^^^^
Support for reading and writing AVIF images is now included in Pillow's wheels, with
libaom available as an encoder and dav1d as a decoder.
Python 3.14 beta
^^^^^^^^^^^^^^^^

View File

@ -760,7 +760,7 @@ def main() -> None:
disabled += ["libimagequant"]
if args.no_fribidi:
disabled += ["fribidi"]
if args.no_avif or args.architecture != "AMD64":
if args.no_avif or args.architecture == "ARM64":
disabled += ["libavif"]
prefs = {