Skip to content

Commit d5e8785

Browse files
authored
Merge pull request #3390 from python-pillow/release-note-headings
Move "Image size" under "API Changes"
2 parents 39e95a6 + bb795fc commit d5e8785

1 file changed

Lines changed: 19 additions & 14 deletions

File tree

docs/releasenotes/5.3.0.rst

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
5.3.0
22
-----
33

4+
API Changes
5+
===========
6+
7+
Image size
8+
^^^^^^^^^^
9+
10+
If you attempt to set the size of an image directly, e.g.
11+
``im.size = (100, 100)``, you will now receive an ``AttributeError``. This is
12+
not about removing existing functionality, but instead about raising an
13+
explicit error to prevent later consequences. The ``resize`` method is the
14+
correct way to change an image's size.
15+
16+
The exceptions to this are:
17+
18+
* The ICO and ICNS image formats, which use ``im.size = (100, 100)`` to select a subimage.
19+
* The TIFF image format, which now has a ``DeprecationWarning`` for this action, as direct image size setting was previously necessary to work around an issue with tile extents.
20+
21+
422
API Additions
523
=============
624

@@ -28,6 +46,7 @@ Now it supports three-color mapping with the optional ``mid`` parameter, and
2846
the positions for all three color arguments can each be optionally specified
2947
(``blackpoint``, ``whitepoint`` and ``midpoint``).
3048
For example, with all optional arguments::
49+
3150
ImageOps.colorize(im, black=(32, 37, 79), white='white', mid=(59, 101, 175),
3251
blackpoint=15, whitepoint=240, midpoint=100)
3352

@@ -39,20 +58,6 @@ and size, new method ``ImageOps.pad`` pads images to fill a requested aspect
3958
ratio and size, filling new space with a provided ``color`` and positioning the
4059
image within the new area through a ``centering`` argument.
4160

42-
Image Size
43-
==========
44-
45-
If you attempt to set the size of an image directly, e.g.
46-
``im.size = (100, 100)``, you will now receive an ``AttributeError``. This is
47-
not about removing existing functionality, but instead about raising an
48-
explicit error to prevent later consequences. The ``resize`` method is the
49-
correct way to change an image's size.
50-
51-
The exceptions to this are:
52-
53-
* The ICO and ICNS image formats, which use ``im.size = (100, 100)`` to select a subimage.
54-
* The TIFF image format, which now has a ``DeprecationWarning`` for this action, as direct image size setting was previously necessary to work around an issue with tile extents.
55-
5661
Other Changes
5762
=============
5863

0 commit comments

Comments
 (0)