弃用和清除¶
这一点,已被弃用,或在过去主要版本已被删除,并给出了替代页面列出 Pillow 的功能,而不是使用。
提倡使用的功能¶
下面是被认为已过时的功能。在适当情况下,一个``DeprecationWarning``发出。
ImageCms.CmsProfile属性¶
3.2.0 版后已移除.
在 ImageCms.CmsProfile
某些属性已被弃用。从6.0.0,他们发出了 DeprecationWarning
:
已过时 |
改用 |
---|---|
|
加厚 |
|
Padded |
|
Unicode |
|
Unicode |
|
Unicode |
|
Unicode |
|
Unicode |
删除的功能¶
提倡使用的功能仅在主要版本删除弃用的适当时期已经过去之后。
Image.__del__¶
删除7.0.0版本。
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.
以前的方法:
im = Image.open("hopper.png")
im.save("out.jpg")
Use instead:
with Image.open("hopper.png") as im:
im.save("out.jpg")
PIL.*ImagePlugin.__version__ attributes¶
删除7.0.0版本。
The version constants of individual plugins have been removed. Use PIL.__version__
instead.
Removed |
Removed |
Removed |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PyQt4 and PySide¶
删除7.0.0版本。
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¶
删除7.0.0版本。
Setting the size of a TIFF image directly (eg. im.size = (256, 256)
) throws
an error. Use Image.resize
instead.
VERSION constant¶
Removed in version 6.0.0.
VERSION
(the old PIL version, always 1.1.7) has been removed. Use
__version__
instead.
Undocumented ImageOps functions¶
Removed in version 6.0.0.
Several undocumented functions in ImageOps
have been removed. Use the equivalents
in ImageFilter
instead:
Removed |
改用 |
---|---|
|
|
|
|
|
|
|
|
|
|
PIL.OleFileIO¶
Removed in version 6.0.0.
PIL.OleFileIO was removed as a vendored file and in Pillow 4.0.0 (2017-01) in favour of
the upstream olefile Python package, and replaced with an ImportError
in 5.0.0
(2018-01). The deprecated file has now been removed from Pillow. If needed, install from
PyPI (eg. pip install olefile
).