Added support for saving JPEG comments

This commit is contained in:
Andrew Murray 2022-12-07 22:30:15 +11:00
parent 4704cab1a1
commit bef128b04b
2 changed files with 13 additions and 0 deletions

View File

@ -474,6 +474,11 @@ The :py:meth:`~PIL.Image.Image.save` method supports the following options:
.. versionadded:: 2.5.0 .. versionadded:: 2.5.0
**comment**
A comment about the image.
.. versionadded:: 9.4.0
.. note:: .. note::

View File

@ -51,6 +51,14 @@ getxmp()
`XMP data <https://en.wikipedia.org/wiki/Extensible_Metadata_Platform>`_ can now be `XMP data <https://en.wikipedia.org/wiki/Extensible_Metadata_Platform>`_ can now be
decoded for WEBP images through ``getxmp()``. decoded for WEBP images through ``getxmp()``.
Writing JPEG comments
^^^^^^^^^^^^^^^^^^^^^
When saving a JPEG image, a comment can now be written from
:py:attr:`~PIL.Image.Image.info`, or by using an argument when saving::
im.save(out, comment="Test comment")
Security Security
======== ========