Skip to content

Commit b72b8dd

Browse files
committed
Removed JpegImageFile.huffman_ac and JpegImageFile.huffman_dc
1 parent 1800e58 commit b72b8dd

File tree

3 files changed

+9
-23
lines changed

3 files changed

+9
-23
lines changed

Tests/test_file_jpeg.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,14 +1115,6 @@ def test_repr_jpeg_error_returns_none(self) -> None:
11151115

11161116
assert im._repr_jpeg_() is None
11171117

1118-
def test_deprecation(self) -> None:
1119-
with Image.open(TEST_FILE) as im:
1120-
assert isinstance(im, JpegImagePlugin.JpegImageFile)
1121-
with pytest.warns(DeprecationWarning, match="huffman_ac"):
1122-
assert im.huffman_ac == {}
1123-
with pytest.warns(DeprecationWarning, match="huffman_dc"):
1124-
assert im.huffman_dc == {}
1125-
11261118

11271119
@pytest.mark.skipif(not is_win32(), reason="Windows only")
11281120
@skip_unless_feature("jpg")

docs/deprecations.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,6 @@ The ``options`` parameter in :py:meth:`~PIL.ImageMath.lambda_eval()` and
122122
:py:meth:`~PIL.ImageMath.unsafe_eval()` has been deprecated. One or more keyword
123123
arguments can be used instead.
124124

125-
JpegImageFile.huffman_ac and JpegImageFile.huffman_dc
126-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
127-
128-
.. deprecated:: 11.0.0
129-
130-
The ``huffman_ac`` and ``huffman_dc`` dictionaries on JPEG images were unused. They
131-
have been deprecated, and will be removed in Pillow 12 (2025-10-15).
132-
133125
Specific WebP feature checks
134126
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
135127

@@ -223,6 +215,15 @@ Image isImageType()
223215
``Image.isImageType(im)`` has been removed. Use ``isinstance(im, Image.Image)``
224216
instead.
225217

218+
JpegImageFile.huffman_ac and JpegImageFile.huffman_dc
219+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
220+
221+
.. deprecated:: 11.0.0
222+
.. versionremoved:: 12.0.0
223+
224+
The ``huffman_ac`` and ``huffman_dc`` dictionaries on JPEG images were unused. They
225+
have been deprecated, and will be removed in Pillow 12 (2025-10-15).
226+
226227
TiffImagePlugin IFD_LEGACY_API
227228
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
228229

src/PIL/JpegImagePlugin.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
from ._binary import i32be as i32
5050
from ._binary import o8
5151
from ._binary import o16be as o16
52-
from ._deprecate import deprecate
5352
from .JpegPresets import presets
5453

5554
TYPE_CHECKING = False
@@ -393,12 +392,6 @@ def _open(self) -> None:
393392

394393
self._read_dpi_from_exif()
395394

396-
def __getattr__(self, name: str) -> Any:
397-
if name in ("huffman_ac", "huffman_dc"):
398-
deprecate(name, 12)
399-
return getattr(self, "_" + name)
400-
raise AttributeError(name)
401-
402395
def __getstate__(self) -> list[Any]:
403396
return super().__getstate__() + [self.layers, self.layer]
404397

0 commit comments

Comments
 (0)