From cce39084f5f0116e9c149b359223d72e3cbe9f24 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 1 Jul 2025 20:09:06 +1000 Subject: [PATCH] Removed specific WebP feature checks --- Tests/test_features.py | 15 --------------- checks/check_wheel.py | 3 --- docs/deprecations.rst | 23 +++++++++++------------ docs/reference/features.rst | 3 --- src/PIL/features.py | 3 --- 5 files changed, 11 insertions(+), 36 deletions(-) diff --git a/Tests/test_features.py b/Tests/test_features.py index d06fb4d84..520c25b46 100644 --- a/Tests/test_features.py +++ b/Tests/test_features.py @@ -55,21 +55,6 @@ def test_version() -> None: test(feature, features.version_feature) -def test_webp_transparency() -> None: - with pytest.warns(DeprecationWarning, match="transp_webp"): - assert (features.check("transp_webp") or False) == features.check_module("webp") - - -def test_webp_mux() -> None: - with pytest.warns(DeprecationWarning, match="webp_mux"): - assert (features.check("webp_mux") or False) == features.check_module("webp") - - -def test_webp_anim() -> None: - with pytest.warns(DeprecationWarning, match="webp_anim"): - assert (features.check("webp_anim") or False) == features.check_module("webp") - - @skip_unless_feature("libjpeg_turbo") def test_libjpeg_turbo_version() -> None: version = features.version("libjpeg_turbo") diff --git a/checks/check_wheel.py b/checks/check_wheel.py index c89d32ed7..3d806eb71 100644 --- a/checks/check_wheel.py +++ b/checks/check_wheel.py @@ -39,9 +39,6 @@ def test_wheel_codecs() -> None: def test_wheel_features() -> None: expected_features = { - "webp_anim", - "webp_mux", - "transp_webp", "raqm", "fribidi", "harfbuzz", diff --git a/docs/deprecations.rst b/docs/deprecations.rst index 8e065fa87..78c6f1092 100644 --- a/docs/deprecations.rst +++ b/docs/deprecations.rst @@ -122,16 +122,6 @@ The ``options`` parameter in :py:meth:`~PIL.ImageMath.lambda_eval()` and :py:meth:`~PIL.ImageMath.unsafe_eval()` has been deprecated. One or more keyword arguments can be used instead. -Specific WebP feature checks -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. deprecated:: 11.0.0 - -``features.check("transp_webp")``, ``features.check("webp_mux")`` and -``features.check("webp_anim")`` are now deprecated. They will always return -``True`` if the WebP module is installed, until they are removed in Pillow -12.0.0 (2025-10-15). - Get internal pointers to objects ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -222,14 +212,23 @@ JpegImageFile.huffman_ac and JpegImageFile.huffman_dc .. versionremoved:: 12.0.0 The ``huffman_ac`` and ``huffman_dc`` dictionaries on JPEG images were unused. They -have been deprecated, and will be removed in Pillow 12 (2025-10-15). +have been removed. + +Specific WebP feature checks +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. deprecated:: 11.0.0 +.. versionremoved:: 12.0.0 + +``features.check("transp_webp")``, ``features.check("webp_mux")`` and +``features.check("webp_anim")`` have been removed. TiffImagePlugin IFD_LEGACY_API ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. versionremoved:: 11.0.0 -``TiffImagePlugin.IFD_LEGACY_API`` was removed, as it was an unused setting. +``TiffImagePlugin.IFD_LEGACY_API`` has been removed, as it was an unused setting. PSFile ~~~~~~ diff --git a/docs/reference/features.rst b/docs/reference/features.rst index 381d7830a..45067ba35 100644 --- a/docs/reference/features.rst +++ b/docs/reference/features.rst @@ -60,9 +60,6 @@ Support for the following features can be checked: * ``raqm``: Raqm library, required for ``ImageFont.Layout.RAQM`` in :py:func:`PIL.ImageFont.truetype`. Run-time version number is available for Raqm 0.7.0 or newer. * ``libimagequant``: (compile time) ImageQuant quantization support in :py:func:`PIL.Image.Image.quantize`. Run-time version number is available. * ``xcb``: (compile time) Support for X11 in :py:func:`PIL.ImageGrab.grab` via the XCB library. -* ``transp_webp``: Deprecated. Always ``True`` if WebP module is installed. -* ``webp_mux``: Deprecated. Always ``True`` if WebP module is installed. -* ``webp_anim``: Deprecated. Always ``True`` if WebP module is installed. .. autofunction:: PIL.features.check_feature .. autofunction:: PIL.features.version_feature diff --git a/src/PIL/features.py b/src/PIL/features.py index 573f1d412..984f7532c 100644 --- a/src/PIL/features.py +++ b/src/PIL/features.py @@ -121,9 +121,6 @@ def get_supported_codecs() -> list[str]: features: dict[str, tuple[str, str | bool, str | None]] = { - "webp_anim": ("PIL._webp", True, None), - "webp_mux": ("PIL._webp", True, None), - "transp_webp": ("PIL._webp", True, None), "raqm": ("PIL._imagingft", "HAVE_RAQM", "raqm_version"), "fribidi": ("PIL._imagingft", "HAVE_FRIBIDI", "fribidi_version"), "harfbuzz": ("PIL._imagingft", "HAVE_HARFBUZZ", "harfbuzz_version"),