From 4e092153fc3e499928e1451c4846dec28b8c02ac Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 30 Nov 2019 18:17:10 +0300 Subject: [PATCH] add release notes --- docs/releasenotes/7.0.0.rst | 14 ++++++++++++++ src/PIL/Image.py | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/releasenotes/7.0.0.rst b/docs/releasenotes/7.0.0.rst index 386a26757..f0612351f 100644 --- a/docs/releasenotes/7.0.0.rst +++ b/docs/releasenotes/7.0.0.rst @@ -47,6 +47,20 @@ Setting the size of TIFF images Setting the size of a TIFF image directly (eg. ``im.size = (256, 256)``) throws an error. Use ``Image.resize`` instead. +Image.draft() return value +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The ``Image.draft()`` method used to return ``None`` or the image itself. +Unlike other `chain methods`_, ``draft()`` modifies the image in-place +rather than returning a modified version. + +In the new version, ``draft()`` returns ``None`` if it has no effect or +a tuple of new image mode and the box of original coordinates in the +bounds of resulting image otherwise +(the box could be useful in subsequent ``resize()`` call). + +.. _chain methods: https://en.wikipedia.org/wiki/Method_chaining + API Changes =========== diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 12280d026..928f33c5f 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -1130,8 +1130,8 @@ class Image: JPEG to greyscale while loading it, or to extract a 128x192 version from a PCD file. - If any changes are made, returns a tuple with the chosen `mode` and - `box` with coordinates of the original image within the altered one. + If any changes are made, returns a tuple with the chosen ``mode`` and + ``box`` with coordinates of the original image within the altered one. Note that this method modifies the :py:class:`~PIL.Image.Image` object in place. If the image has already been loaded, this method has no