From 92992bd19d69dc6cfc0d0654f784fdecb98c18fd Mon Sep 17 00:00:00 2001 From: chrysos349 Date: Tue, 22 Jul 2025 03:03:13 +0300 Subject: [PATCH] python3-pillow_heif: update to 1.0.0 Closes: #56394 [via git-merge-pr] --- srcpkgs/python3-pillow_heif/patches/363.patch | 72 +++++++++++++++++++ srcpkgs/python3-pillow_heif/template | 4 +- 2 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/python3-pillow_heif/patches/363.patch diff --git a/srcpkgs/python3-pillow_heif/patches/363.patch b/srcpkgs/python3-pillow_heif/patches/363.patch new file mode 100644 index 00000000000..5f6deeaa929 --- /dev/null +++ b/srcpkgs/python3-pillow_heif/patches/363.patch @@ -0,0 +1,72 @@ +see https://github.com/bigcat88/pillow_heif/pull/363 +--- a/pillow_heif/_pillow_heif.c ++++ b/pillow_heif/_pillow_heif.c +@@ -2,6 +2,9 @@ + + #include "Python.h" + #include "libheif/heif.h" ++#if LIBHEIF_HAVE_VERSION(1,20,0) ++ #include "libheif/heif_properties.h" ++#endif + #include "_ph_postprocess.h" + + /* =========== Common stuff ======== */ +--- a/tests/basic_test.py ++++ b/tests/basic_test.py +@@ -18,7 +18,7 @@ def test_libheif_info(): + assert key in info + + version = pillow_heif.libheif_version() +- valid_prefixes = ["1.17.", "1.18.", "1.19."] ++ valid_prefixes = ["1.17.", "1.18.", "1.19.", "1.20."] + assert any(version.startswith(prefix) for prefix in valid_prefixes) + + +@@ -107,7 +107,7 @@ def test_full_build(): + assert info["HEIF"] + assert info["encoders"] + assert info["decoders"] +- expected_version = os.getenv("EXP_PH_LIBHEIF_VERSION", "1.19.8") ++ expected_version = os.getenv("EXP_PH_LIBHEIF_VERSION", "1.20.1") + if expected_version: + assert info["libheif"] == expected_version + +@@ -118,7 +118,7 @@ def test_light_build(): + assert not info["AVIF"] + assert not info["HEIF"] + assert info["decoders"] +- expected_version = os.getenv("EXP_PH_LIBHEIF_VERSION", "1.19.8") ++ expected_version = os.getenv("EXP_PH_LIBHEIF_VERSION", "1.20.1") + if expected_version: + assert info["libheif"] == expected_version + +--- a/tests/read_test.py ++++ b/tests/read_test.py +@@ -533,14 +533,16 @@ def test_invalid_decoder(): + pillow_heif.options.PREFERRED_DECODER["HEIF"] = "" + + +-@pytest.mark.skipif( +- parse_version(pillow_heif.libheif_version()) < parse_version("1.19.7"), reason="Requires libheif 1.19.7." +-) +-def test_200_megapixels(): +- with pytest.raises(RuntimeError): +- _ = pillow_heif.open_heif("images/heif_special/200MP.heic").data +- try: +- pillow_heif.options.DISABLE_SECURITY_LIMITS = True +- _ = pillow_heif.open_heif("images/heif_special/200MP.heic").data +- finally: +- pillow_heif.options.DISABLE_SECURITY_LIMITS = False ++# to-do: looks like we need now image with 400MP size to hit the security limits :( ++# ++# @pytest.mark.skipif( ++# parse_version(pillow_heif.libheif_version()) < parse_version("1.19.7"), reason="Requires libheif 1.19.7" ++# ) ++# def test_200_megapixels(): ++# with pytest.raises(RuntimeError): ++# _ = pillow_heif.open_heif("images/heif_special/200MP.heic").data ++# try: ++# pillow_heif.options.DISABLE_SECURITY_LIMITS = True ++# _ = pillow_heif.open_heif("images/heif_special/200MP.heic").data ++# finally: ++# pillow_heif.options.DISABLE_SECURITY_LIMITS = False diff --git a/srcpkgs/python3-pillow_heif/template b/srcpkgs/python3-pillow_heif/template index c9338b7a4b3..c8fc8308810 100644 --- a/srcpkgs/python3-pillow_heif/template +++ b/srcpkgs/python3-pillow_heif/template @@ -1,6 +1,6 @@ # Template file for 'python3-pillow_heif' pkgname=python3-pillow_heif -version=0.22.0 +version=1.0.0 revision=1 build_style=python3-module hostmakedepends="python3-setuptools" @@ -13,7 +13,7 @@ license="BSD-3-Clause" homepage="https://github.com/bigcat88/pillow_heif" changelog="https://raw.githubusercontent.com/bigcat88/pillow_heif/master/CHANGELOG.md" distfiles="${PYPI_SITE}/p/pillow_heif/pillow_heif-${version}.tar.gz" -checksum=61d473929340d3073722f6316b7fbbdb11132faa6bac0242328e8436cc55b39a +checksum=0df7a1fb29bd55bc77fd286195eeb02604e356a5da3d5e8786129b91263b99e2 post_install() { vlicense LICENSE.txt