mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
109 lines
3.6 KiB
ReStructuredText
109 lines
3.6 KiB
ReStructuredText
7.0.0
|
|
-----
|
|
|
|
Backwards Incompatible Changes
|
|
==============================
|
|
|
|
PILLOW_VERSION constant
|
|
^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
``PILLOW_VERSION`` has been removed. Use ``__version__`` instead.
|
|
|
|
PIL.*ImagePlugin.__version__ attributes
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
The version constants of individual plugins have been removed. Use ``PIL.__version__``
|
|
instead.
|
|
|
|
=============================== ================================= ==================================
|
|
Removed Removed Removed
|
|
=============================== ================================= ==================================
|
|
``BmpImagePlugin.__version__`` ``Jpeg2KImagePlugin.__version__`` ``PngImagePlugin.__version__``
|
|
``CurImagePlugin.__version__`` ``JpegImagePlugin.__version__`` ``PpmImagePlugin.__version__``
|
|
``DcxImagePlugin.__version__`` ``McIdasImagePlugin.__version__`` ``PsdImagePlugin.__version__``
|
|
``EpsImagePlugin.__version__`` ``MicImagePlugin.__version__`` ``SgiImagePlugin.__version__``
|
|
``FliImagePlugin.__version__`` ``MpegImagePlugin.__version__`` ``SunImagePlugin.__version__``
|
|
``FpxImagePlugin.__version__`` ``MpoImagePlugin.__version__`` ``TgaImagePlugin.__version__``
|
|
``GdImageFile.__version__`` ``MspImagePlugin.__version__`` ``TiffImagePlugin.__version__``
|
|
``GifImagePlugin.__version__`` ``PalmImagePlugin.__version__`` ``WmfImagePlugin.__version__``
|
|
``IcoImagePlugin.__version__`` ``PcdImagePlugin.__version__`` ``XbmImagePlugin.__version__``
|
|
``ImImagePlugin.__version__`` ``PcxImagePlugin.__version__`` ``XpmImagePlugin.__version__``
|
|
``ImtImagePlugin.__version__`` ``PdfImagePlugin.__version__`` ``XVThumbImagePlugin.__version__``
|
|
``IptcImagePlugin.__version__`` ``PixarImagePlugin.__version__``
|
|
=============================== ================================= ==================================
|
|
|
|
PyQt4 and PySide
|
|
^^^^^^^^^^^^^^^^
|
|
|
|
Qt 4 reached end-of-life on 2015-12-19. Its Python bindings are also EOL: PyQt4 since
|
|
2018-08-31 and PySide since 2015-10-14.
|
|
|
|
Support for PyQt4 and PySide has been removed from ``ImageQt``. Please upgrade to PyQt5
|
|
or PySide2.
|
|
|
|
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
|
|
===========
|
|
|
|
Deprecations
|
|
^^^^^^^^^^^^
|
|
|
|
TODO
|
|
~~~~
|
|
|
|
TODO
|
|
|
|
|
|
API Additions
|
|
=============
|
|
|
|
Custom unidentified image error
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
Pillow will now throw a custom ``UnidentifiedImageError`` when an image cannot be
|
|
identified. For backwards compatibility, this will inherit from ``IOError``.
|
|
|
|
Other Changes
|
|
=============
|
|
|
|
Image.__del__
|
|
^^^^^^^^^^^^^
|
|
|
|
Implicitly closing the image's underlying file in ``Image.__del__`` has been removed.
|
|
Use a context manager or call ``Image.close()`` instead to close the file in a
|
|
deterministic way.
|
|
|
|
Previous method:
|
|
|
|
.. code-block:: python
|
|
|
|
im = Image.open("hopper.png")
|
|
im.save("out.jpg")
|
|
|
|
Use instead:
|
|
|
|
.. code-block:: python
|
|
|
|
with Image.open("hopper.png") as im:
|
|
im.save("out.jpg")
|