Pillow/docs/releasenotes/9.1.0.rst

57 lines
1.9 KiB
ReStructuredText
Raw Normal View History

2022-02-10 04:15:25 +03:00
9.1.0
-----
2022-02-10 04:33:42 +03:00
API Changes
===========
Raise an error when performing a negative crop
2022-02-10 05:56:27 +03:00
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2022-02-10 04:33:42 +03:00
2022-02-10 05:56:27 +03:00
Performing a negative crop on an image previously just returned a ``(0, 0)`` image. Now
it will raise a ``ValueError``, to help reduce confusion if a user has unintentionally
2022-02-10 04:33:42 +03:00
provided the wrong arguments.
2022-02-10 04:41:36 +03:00
Added specific error if path coordinate type is incorrect
2022-02-10 05:56:27 +03:00
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2022-02-10 04:41:36 +03:00
2022-02-10 05:56:27 +03:00
Rather than returning a ``SystemError``, passing the incorrect types of coordinates into
a path will now raise a more specific ``ValueError``, with the message "incorrect
2022-02-10 04:41:36 +03:00
coordinate type".
2022-02-10 05:56:27 +03:00
Deprecations
^^^^^^^^^^^^
ImageShow.Viewer.show_file file argument
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ``file`` argument in :py:meth:`~PIL.ImageShow.Viewer.show_file()` has been
deprecated, replaced by ``path``.
In effect, ``viewer.show_file("test.jpg")`` will continue to work unchanged.
``viewer.show_file(file="test.jpg")`` will raise a deprecation warning, and suggest
``viewer.show_file(path="test.jpg")`` instead.
2022-02-10 04:15:25 +03:00
API Additions
=============
Added get_photoshop_blocks() to parse Photoshop TIFF tag
2022-02-10 05:56:27 +03:00
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2022-02-10 04:15:25 +03:00
:py:meth:`~PIL.TiffImagePlugin.TiffImageFile.get_photoshop_blocks` has been added, to
allow users to determine what Photoshop "Image Resource Blocks" are contained within an
image. The keys of the returned dictionary are the image resource IDs.
At present, the information within each block is merely returned as a dictionary with a
"data" entry. This will allow more useful information to be added in the future without
breaking backwards compatibility.
2022-02-10 05:53:30 +03:00
Other Changes
=============
Image._repr_pretty_
2022-02-10 05:56:27 +03:00
^^^^^^^^^^^^^^^^^^^
2022-02-10 05:53:30 +03:00
2022-02-10 05:56:27 +03:00
``im._repr_pretty_`` has been added to provide a representation of an image without the
2022-02-10 05:53:30 +03:00
identity of the object. This allows Jupyter to describe an image and have that
description stay the same on subsequent executions of the same code.