From 7a0092f2072a5deca433e2a6b752eced49e4ee16 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sat, 12 Apr 2025 18:56:38 +0300 Subject: [PATCH] Remove incomplete 11.2.0 release, bill as 11.2.1 instead --- docs/deprecations.rst | 2 +- docs/handbook/image-file-formats.rst | 2 +- docs/reference/ImageDraw.rst | 8 +- docs/reference/ImageGrab.rst | 2 +- docs/releasenotes/11.2.0.rst | 116 -------------------------- docs/releasenotes/11.2.1.rst | 117 +++++++++++++++++++++++++-- docs/releasenotes/index.rst | 1 - src/PIL/Image.py | 2 +- 8 files changed, 120 insertions(+), 130 deletions(-) delete mode 100644 docs/releasenotes/11.2.0.rst diff --git a/docs/deprecations.rst b/docs/deprecations.rst index 634cee689..7f8e76bcc 100644 --- a/docs/deprecations.rst +++ b/docs/deprecations.rst @@ -186,7 +186,7 @@ ExifTags.IFD.Makernote Image.Image.get_child_images() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. deprecated:: 11.2.0 +.. deprecated:: 11.2.1 ``Image.Image.get_child_images()`` has been deprecated. and will be removed in Pillow 13 (2026-10-15). It will be moved to ``ImageFile.ImageFile.get_child_images()``. The diff --git a/docs/handbook/image-file-formats.rst b/docs/handbook/image-file-formats.rst index bfa462c04..49431b3d0 100644 --- a/docs/handbook/image-file-formats.rst +++ b/docs/handbook/image-file-formats.rst @@ -170,7 +170,7 @@ DXT1 and DXT5 pixel formats can be read, only in ``RGBA`` mode. in ``P`` mode. -.. versionadded:: 11.2.0 +.. versionadded:: 11.2.1 DXT1, DXT3, DXT5, BC2, BC3 and BC5 pixel formats can be saved:: im.save(out, pixel_format="DXT1") diff --git a/docs/reference/ImageDraw.rst b/docs/reference/ImageDraw.rst index b2f1bdc93..bd6f6b048 100644 --- a/docs/reference/ImageDraw.rst +++ b/docs/reference/ImageDraw.rst @@ -391,7 +391,7 @@ Methods the relative alignment of lines. Use the ``anchor`` parameter to specify the alignment to ``xy``. - .. versionadded:: 11.2.0 ``"justify"`` + .. versionadded:: 11.2.1 ``"justify"`` :param direction: Direction of the text. It can be ``"rtl"`` (right to left), ``"ltr"`` (left to right) or ``"ttb"`` (top to bottom). Requires libraqm. @@ -462,7 +462,7 @@ Methods the relative alignment of lines. Use the ``anchor`` parameter to specify the alignment to ``xy``. - .. versionadded:: 11.2.0 ``"justify"`` + .. versionadded:: 11.2.1 ``"justify"`` :param direction: Direction of the text. It can be ``"rtl"`` (right to left), ``"ltr"`` (left to right) or ``"ttb"`` (top to bottom). Requires libraqm. @@ -609,7 +609,7 @@ Methods the relative alignment of lines. Use the ``anchor`` parameter to specify the alignment to ``xy``. - .. versionadded:: 11.2.0 ``"justify"`` + .. versionadded:: 11.2.1 ``"justify"`` :param direction: Direction of the text. It can be ``"rtl"`` (right to left), ``"ltr"`` (left to right) or ``"ttb"`` (top to bottom). Requires libraqm. @@ -663,7 +663,7 @@ Methods the relative alignment of lines. Use the ``anchor`` parameter to specify the alignment to ``xy``. - .. versionadded:: 11.2.0 ``"justify"`` + .. versionadded:: 11.2.1 ``"justify"`` :param direction: Direction of the text. It can be ``"rtl"`` (right to left), ``"ltr"`` (left to right) or ``"ttb"`` (top to bottom). Requires libraqm. diff --git a/docs/reference/ImageGrab.rst b/docs/reference/ImageGrab.rst index d59ed0bd6..1e827a676 100644 --- a/docs/reference/ImageGrab.rst +++ b/docs/reference/ImageGrab.rst @@ -44,7 +44,7 @@ or the clipboard to a PIL image memory. :param window: HWND, to capture a single window. Windows only. - .. versionadded:: 11.2.0 + .. versionadded:: 11.2.1 :return: An image .. py:function:: grabclipboard() diff --git a/docs/releasenotes/11.2.0.rst b/docs/releasenotes/11.2.0.rst deleted file mode 100644 index 3a7d618e4..000000000 --- a/docs/releasenotes/11.2.0.rst +++ /dev/null @@ -1,116 +0,0 @@ -11.2.0 ------- - -.. warning:: - - The release of Pillow 11.2.0 was halted prematurely, due to concern over the size - of Pillow wheels containing libavif. Instead, Pillow 11.2.1 has been released, - without libavif included in the wheels. - -Security -======== - -Undefined shift when loading compressed DDS images -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -When loading some compressed DDS formats, an integer was bitshifted by 24 places to -generate the 32 bits of the lookup table. This was undefined behaviour, and has been -present since Pillow 3.4.0. - -Deprecations -============ - -Image.Image.get_child_images() -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. deprecated:: 11.2.0 - -``Image.Image.get_child_images()`` has been deprecated. and will be removed in Pillow -13 (2026-10-15). It will be moved to ``ImageFile.ImageFile.get_child_images()``. The -method uses an image's file pointer, and so child images could only be retrieved from -an :py:class:`PIL.ImageFile.ImageFile` instance. - -API Changes -=========== - -``append_images`` no longer requires ``save_all`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Previously, ``save_all`` was required to in order to use ``append_images``. Now, -``save_all`` will default to ``True`` if ``append_images`` is not empty and the format -supports saving multiple frames:: - - im.save("out.gif", append_images=ims) - -API Additions -============= - -``"justify"`` multiline text alignment -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -In addition to ``"left"``, ``"center"`` and ``"right"``, multiline text can also be -aligned using ``"justify"`` in :py:mod:`~PIL.ImageDraw`:: - - from PIL import Image, ImageDraw - im = Image.new("RGB", (50, 25)) - draw = ImageDraw.Draw(im) - draw.multiline_text((0, 0), "Multiline\ntext 1", align="justify") - draw.multiline_textbbox((0, 0), "Multiline\ntext 2", align="justify") - -Specify window in ImageGrab on Windows -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -When using :py:meth:`~PIL.ImageGrab.grab`, a specific window can be selected using the -HWND:: - - from PIL import ImageGrab - ImageGrab.grab(window=hwnd) - -Check for MozJPEG -^^^^^^^^^^^^^^^^^ - -You can check if Pillow has been built against the MozJPEG version of the -libjpeg library, and what version of MozJPEG is being used:: - - from PIL import features - features.check_feature("mozjpeg") # True or False - features.version_feature("mozjpeg") # "4.1.1" for example, or None - -Saving compressed DDS images -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Compressed DDS images can now be saved using a ``pixel_format`` argument. DXT1, DXT3, -DXT5, BC2, BC3 and BC5 are supported:: - - im.save("out.dds", pixel_format="DXT1") - -Other Changes -============= - -Arrow support -^^^^^^^^^^^^^ - -`Arrow `__ is an in-memory data exchange format that is the -spiritual successor to the NumPy array interface. It provides for zero-copy access to -columnar data, which in our case is ``Image`` data. - -To create an image with zero-copy shared memory from an object exporting the -arrow_c_array interface protocol:: - - from PIL import Image - import pyarrow as pa - arr = pa.array([0]*(5*5*4), type=pa.uint8()) - im = Image.fromarrow(arr, 'RGBA', (5, 5)) - -Pillow images can also be converted to Arrow objects:: - - from PIL import Image - import pyarrow as pa - im = Image.open('hopper.jpg') - arr = pa.array(im) - -Reading and writing AVIF images -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Pillow can now read and write AVIF images. If you are building Pillow from source, this -will require libavif 1.0.0 or later. diff --git a/docs/releasenotes/11.2.1.rst b/docs/releasenotes/11.2.1.rst index 7d9a40382..5c6d40d9d 100644 --- a/docs/releasenotes/11.2.1.rst +++ b/docs/releasenotes/11.2.1.rst @@ -1,11 +1,118 @@ 11.2.1 ------ +.. warning:: + + The release of Pillow *11.2.0* was halted prematurely, due to hitting PyPI's + project size limit and concern over the size of Pillow wheels containing libavif. + The PyPI limit has now been increased and Pillow *11.2.1* has been released + instead, without libavif included in the wheels. + To avoid confusion, the incomplete 11.2.0 release has been removed from PyPI. + +Security +======== + +Undefined shift when loading compressed DDS images +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +When loading some compressed DDS formats, an integer was bitshifted by 24 places to +generate the 32 bits of the lookup table. This was undefined behaviour, and has been +present since Pillow 3.4.0. + +Deprecations +============ + +Image.Image.get_child_images() +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. deprecated:: 11.2.1 + +``Image.Image.get_child_images()`` has been deprecated. and will be removed in Pillow +13 (2026-10-15). It will be moved to ``ImageFile.ImageFile.get_child_images()``. The +method uses an image's file pointer, and so child images could only be retrieved from +an :py:class:`PIL.ImageFile.ImageFile` instance. + +API Changes +=========== + +``append_images`` no longer requires ``save_all`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Previously, ``save_all`` was required to in order to use ``append_images``. Now, +``save_all`` will default to ``True`` if ``append_images`` is not empty and the format +supports saving multiple frames:: + + im.save("out.gif", append_images=ims) + +API Additions +============= + +``"justify"`` multiline text alignment +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In addition to ``"left"``, ``"center"`` and ``"right"``, multiline text can also be +aligned using ``"justify"`` in :py:mod:`~PIL.ImageDraw`:: + + from PIL import Image, ImageDraw + im = Image.new("RGB", (50, 25)) + draw = ImageDraw.Draw(im) + draw.multiline_text((0, 0), "Multiline\ntext 1", align="justify") + draw.multiline_textbbox((0, 0), "Multiline\ntext 2", align="justify") + +Specify window in ImageGrab on Windows +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +When using :py:meth:`~PIL.ImageGrab.grab`, a specific window can be selected using the +HWND:: + + from PIL import ImageGrab + ImageGrab.grab(window=hwnd) + +Check for MozJPEG +^^^^^^^^^^^^^^^^^ + +You can check if Pillow has been built against the MozJPEG version of the +libjpeg library, and what version of MozJPEG is being used:: + + from PIL import features + features.check_feature("mozjpeg") # True or False + features.version_feature("mozjpeg") # "4.1.1" for example, or None + +Saving compressed DDS images +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Compressed DDS images can now be saved using a ``pixel_format`` argument. DXT1, DXT3, +DXT5, BC2, BC3 and BC5 are supported:: + + im.save("out.dds", pixel_format="DXT1") + +Other Changes +============= + +Arrow support +^^^^^^^^^^^^^ + +`Arrow `__ is an in-memory data exchange format that is the +spiritual successor to the NumPy array interface. It provides for zero-copy access to +columnar data, which in our case is ``Image`` data. + +To create an image with zero-copy shared memory from an object exporting the +arrow_c_array interface protocol:: + + from PIL import Image + import pyarrow as pa + arr = pa.array([0]*(5*5*4), type=pa.uint8()) + im = Image.fromarrow(arr, 'RGBA', (5, 5)) + +Pillow images can also be converted to Arrow objects:: + + from PIL import Image + import pyarrow as pa + im = Image.open('hopper.jpg') + arr = pa.array(im) + Reading and writing AVIF images ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The release of Pillow 11.2.0 was halted prematurely, due to concern over the size of -Pillow wheels containing libavif. - -Instead, Pillow 11.2.1's wheels do not contain libavif. If you wish to read and write -AVIF images, you will need to build Pillow from source with libavif 1.0.0 or later. +Pillow can now read and write AVIF images when built from source with libavif 1.0.0 +or later. diff --git a/docs/releasenotes/index.rst b/docs/releasenotes/index.rst index 0d159fc51..a116ef056 100644 --- a/docs/releasenotes/index.rst +++ b/docs/releasenotes/index.rst @@ -15,7 +15,6 @@ expected to be backported to earlier versions. :maxdepth: 2 11.2.1 - 11.2.0 11.1.0 11.0.0 10.4.0 diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 88ea6f3b5..ded40bc5d 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -3362,7 +3362,7 @@ def fromarrow( See: :ref:`arrow-support` for more detailed information - .. versionadded:: 11.2.0 + .. versionadded:: 11.2.1 """ if not hasattr(obj, "__arrow_c_array__"):