Pillow/docs/releasenotes/4.1.0.rst

87 lines
3.1 KiB
ReStructuredText
Raw Normal View History

2017-04-03 23:21:32 +03:00
4.1.0
-----
Removed Deprecated Items
========================
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.
* The methods :py:meth:`PIL.ImageDraw.ImageDraw.setink`,
:py:meth:`PIL.ImageDraw.ImageDraw.setfill`, and
:py:meth:`PIL.ImageDraw.ImageDraw.setfont` have been removed.
Closing Files When Opening Images
=================================
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
only one frame, the file is closed after loading.
* 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
will be closed in the ``close`` or ``__del__`` method.
Changes to GIF Handling When Saving
===================================
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
optimizing the image palette.
This refactor fixed some bugs with palette handling when saving
multiple frame GIFs.
New Method: Image.remap_palette
===============================
The method :py:meth:`PIL.Image.Image.remap_palette()` has been
added. This method was hoisted from the GifImagePlugin code used to
optimize the palette.
Added Decoder Registry and Support for Python Based Decoders
============================================================
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
=====
Many tests have been added, including correctness tests for image
formats that have been previously untested.
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.