document IptcImagePlugin deprecations

This commit is contained in:
Nulano 2023-12-31 01:25:19 +01:00 committed by Hugo van Kemenade
parent fa4b3776f0
commit aa605bc6f2
3 changed files with 20 additions and 3 deletions

View File

@ -44,6 +44,17 @@ ImageFile.raise_oserror
error codes returned by a codec's ``decode()`` method, which ImageFile already does error codes returned by a codec's ``decode()`` method, which ImageFile already does
automatically. automatically.
IptcImageFile helper functions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. deprecated:: 10.2.0
The functions ``IptcImageFile.dump`` and ``IptcImageFile.i``, and the constant
``IptcImageFile.PAD`` have been deprecated and will be removed in Pillow
12.0.0 (2025-10-15). These are undocumented helper functions intended
for internal use, so there is no replacement. They can each be replaced
by a single line of code using builtin functions in Python.
Removed features Removed features
---------------- ----------------

View File

@ -20,10 +20,14 @@ ImageFile.raise_oserror
error codes returned by a codec's ``decode()`` method, which ImageFile already does error codes returned by a codec's ``decode()`` method, which ImageFile already does
automatically. automatically.
TODO IptcImageFile helper functions
^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TODO The functions ``IptcImageFile.dump`` and ``IptcImageFile.i``, and the constant
``IptcImageFile.PAD`` have been deprecated and will be removed in Pillow
12.0.0 (2025-10-15). These are undocumented helper functions intended
for internal use, so there is no replacement. They can each be replaced
by a single line of code using builtin functions in Python.
API Changes API Changes
=========== ===========

View File

@ -48,11 +48,13 @@ def _i8(c: int | bytes) -> int:
def i(c): def i(c):
""".. deprecated:: 10.2.0"""
deprecate("IptcImagePlugin.i", 12) deprecate("IptcImagePlugin.i", 12)
return _i(c) return _i(c)
def dump(c): def dump(c):
""".. deprecated:: 10.2.0"""
deprecate("IptcImagePlugin.dump", 12) deprecate("IptcImagePlugin.dump", 12)
for i in c: for i in c:
print("%02x" % _i8(i), end=" ") print("%02x" % _i8(i), end=" ")