2017-04-03 23:21:32 +03:00
|
|
|
4.1.0
|
|
|
|
-----
|
|
|
|
|
2024-03-15 03:21:00 +03:00
|
|
|
Deprecations
|
|
|
|
============
|
2017-04-03 23:21:32 +03:00
|
|
|
|
|
|
|
Several deprecated items have been removed.
|
|
|
|
|
2017-04-04 09:38:00 +03:00
|
|
|
* Support for spaces in tiff kwargs in the parameters for 'x resolution', 'y
|
2017-04-03 23:21:32 +03:00
|
|
|
resolution', 'resolution unit', and 'date time' has been
|
|
|
|
removed. Underscores should be used instead.
|
|
|
|
|
2020-07-09 21:19:34 +03:00
|
|
|
* The methods ``PIL.ImageDraw.ImageDraw.setink``,
|
|
|
|
``PIL.ImageDraw.ImageDraw.setfill``, and
|
|
|
|
``PIL.ImageDraw.ImageDraw.setfont`` have been removed.
|
2017-04-03 23:21:32 +03:00
|
|
|
|
|
|
|
|
2024-03-15 03:21:00 +03:00
|
|
|
Other Changes
|
|
|
|
=============
|
|
|
|
|
2017-04-03 23:21:32 +03:00
|
|
|
Closing Files When Opening Images
|
2024-03-15 03:21:00 +03:00
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-04-03 23:21:32 +03:00
|
|
|
|
|
|
|
The file handling when opening images has been overhauled. Previously,
|
2017-04-04 09:38:00 +03:00
|
|
|
Pillow would attempt to close some, but not all image formats
|
|
|
|
after loading the image data. Now, the following behavior
|
2017-04-03 23:21:32 +03:00
|
|
|
is specified:
|
|
|
|
|
|
|
|
* For images where an open file is passed in, it is the
|
|
|
|
responsibility of the calling code to close the file.
|
|
|
|
|
|
|
|
* For images where Pillow opens the file and the file is known to have
|
2018-01-27 09:04:46 +03:00
|
|
|
only one frame, the file is closed after loading.
|
2017-04-03 23:21:32 +03:00
|
|
|
|
|
|
|
* If the file has more than one frame, or if it can't be determined,
|
|
|
|
then the file is left open to permit seeking to subsequent
|
|
|
|
frames. It will be closed, eventually, in the ``close`` or
|
2017-04-04 09:38:00 +03:00
|
|
|
``__del__`` methods.
|
2017-04-03 23:21:32 +03:00
|
|
|
|
|
|
|
* If the image is memory mapped, then we can't close the mapping to
|
|
|
|
the underlying file until we are done with the image. The mapping
|
2018-01-27 09:04:46 +03:00
|
|
|
will be closed in the ``close`` or ``__del__`` method.
|
2017-04-03 23:21:32 +03:00
|
|
|
|
|
|
|
Changes to GIF Handling When Saving
|
2024-03-15 03:21:00 +03:00
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-04-03 23:21:32 +03:00
|
|
|
|
|
|
|
The :py:class:`PIL.GifImagePlugin` code has been refactored to fix the flow when
|
|
|
|
saving images. There are two external changes that arise from this:
|
|
|
|
|
|
|
|
* An :py:class:`PIL.ImagePalette.ImagePalette` object is now accepted
|
|
|
|
as a specified palette argument in :py:meth:`PIL.Image.Image.save()`.
|
|
|
|
|
|
|
|
* The image to be saved is no longer modified in place by any of the
|
|
|
|
operations of the save function. Previously it was modified when
|
2018-01-27 09:04:46 +03:00
|
|
|
optimizing the image palette.
|
2017-04-03 23:21:32 +03:00
|
|
|
|
|
|
|
This refactor fixed some bugs with palette handling when saving
|
|
|
|
multiple frame GIFs.
|
|
|
|
|
|
|
|
New Method: Image.remap_palette
|
2024-03-15 03:50:17 +03:00
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-04-03 23:21:32 +03:00
|
|
|
|
|
|
|
The method :py:meth:`PIL.Image.Image.remap_palette()` has been
|
|
|
|
added. This method was hoisted from the GifImagePlugin code used to
|
2018-01-27 09:04:46 +03:00
|
|
|
optimize the palette.
|
2017-04-03 23:21:32 +03:00
|
|
|
|
|
|
|
Added Decoder Registry and Support for Python Based Decoders
|
2024-03-15 03:50:17 +03:00
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-04-03 23:21:32 +03:00
|
|
|
|
|
|
|
There is now a decoder registry similar to the image plugin
|
|
|
|
registries. Image plugins can register a decoder, and it will be
|
|
|
|
called when the decoding is requested. This allows for the creation of
|
2017-04-04 09:38:00 +03:00
|
|
|
pure Python decoders. While the Python decoders will not be as fast as
|
2017-04-03 23:21:32 +03:00
|
|
|
their C based counterparts, they may be easier and quicker to develop
|
|
|
|
or safer to run.
|
|
|
|
|
|
|
|
Tests
|
2024-03-15 03:50:17 +03:00
|
|
|
^^^^^
|
2017-04-03 23:21:32 +03:00
|
|
|
|
|
|
|
Many tests have been added, including correctness tests for image
|
2018-01-27 09:04:46 +03:00
|
|
|
formats that have been previously untested.
|
2017-04-03 23:21:32 +03:00
|
|
|
|
|
|
|
We are now running automated tests in Docker containers against more
|
2017-04-04 09:38:00 +03:00
|
|
|
Linux versions than are provided on Travis CI, which is currently
|
|
|
|
Ubuntu 14.04 x64. This Pillow release is tested on 64-bit Alpine,
|
|
|
|
Arch, Ubuntu 12.04 and 16.04, and 32-bit Debian Stretch and Ubuntu
|
2017-04-03 23:21:32 +03:00
|
|
|
14.04. This also covers a wider range of dependency versions than are
|
|
|
|
provided on Travis natively.
|