Removed JpegImageFile.huffman_ac and JpegImageFile.huffman_dc

This commit is contained in:
Andrew Murray 2025-07-01 20:04:08 +10:00
parent 1800e580d2
commit b72b8dd84d
3 changed files with 9 additions and 23 deletions

View File

@ -1115,14 +1115,6 @@ class TestFileJpeg:
assert im._repr_jpeg_() is None assert im._repr_jpeg_() is None
def test_deprecation(self) -> None:
with Image.open(TEST_FILE) as im:
assert isinstance(im, JpegImagePlugin.JpegImageFile)
with pytest.warns(DeprecationWarning, match="huffman_ac"):
assert im.huffman_ac == {}
with pytest.warns(DeprecationWarning, match="huffman_dc"):
assert im.huffman_dc == {}
@pytest.mark.skipif(not is_win32(), reason="Windows only") @pytest.mark.skipif(not is_win32(), reason="Windows only")
@skip_unless_feature("jpg") @skip_unless_feature("jpg")

View File

@ -122,14 +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 :py:meth:`~PIL.ImageMath.unsafe_eval()` has been deprecated. One or more keyword
arguments can be used instead. arguments can be used instead.
JpegImageFile.huffman_ac and JpegImageFile.huffman_dc
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. deprecated:: 11.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).
Specific WebP feature checks Specific WebP feature checks
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -223,6 +215,15 @@ Image isImageType()
``Image.isImageType(im)`` has been removed. Use ``isinstance(im, Image.Image)`` ``Image.isImageType(im)`` has been removed. Use ``isinstance(im, Image.Image)``
instead. instead.
JpegImageFile.huffman_ac and JpegImageFile.huffman_dc
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. deprecated:: 11.0.0
.. 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).
TiffImagePlugin IFD_LEGACY_API TiffImagePlugin IFD_LEGACY_API
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -49,7 +49,6 @@ from ._binary import i16be as i16
from ._binary import i32be as i32 from ._binary import i32be as i32
from ._binary import o8 from ._binary import o8
from ._binary import o16be as o16 from ._binary import o16be as o16
from ._deprecate import deprecate
from .JpegPresets import presets from .JpegPresets import presets
TYPE_CHECKING = False TYPE_CHECKING = False
@ -393,12 +392,6 @@ class JpegImageFile(ImageFile.ImageFile):
self._read_dpi_from_exif() self._read_dpi_from_exif()
def __getattr__(self, name: str) -> Any:
if name in ("huffman_ac", "huffman_dc"):
deprecate(name, 12)
return getattr(self, "_" + name)
raise AttributeError(name)
def __getstate__(self) -> list[Any]: def __getstate__(self) -> list[Any]:
return super().__getstate__() + [self.layers, self.layer] return super().__getstate__() + [self.layers, self.layer]