阅读(3747) 赞(5)

Pillow features模块

2021-07-16 16:22:49 更新

这个 PIL.​features ​模块可用于检测您的系统上有哪些可用的Pillow功能。

​PIL.features.pilinfo(out=None, supported_formats=True)​

打印有关此Pillow安装的信息。可以使用python -m PIL 调用此函数 。

参数
  • out -- 要打印到的输出流。如果为 None,则默认为 sys.stdout .

  • supported_formats -- 如果 True ,将打印所有支持的图像文件格式的列表。

​PIL.features.check(feature)​
参数

feature -- 模块、编解码器或功能名称。

返回

True 则模块、编解码器或功能可用, False 或 None 为其他方式。

​PIL.features.version(feature)​
参数

feature -- 要检查的模块、编解码器或功能。

返回

一个代表版本号的字符串,如果返回 None 代表未知或不可用。

​PIL.features.get_supported()​
返回

所有支持的模块、功能和编解码器的列表。

模块

可以检查对以下模块的支持:

  • ​pil ​:pillow 核心模块,所有功能都需要。
  • ​tkinter​:Tkinter支持。版本号不可用。
  • ​freetype2 ​:FreeType字体支持 ​PIL.ImageFont.truetype() 。
  • ​littlecms2​ :LittleCMS 2支持通过 ​PIL.ImageCms​ 。
  • ​webp ​:WebP映像支持。
​PIL.features.check_module(feature)​

检查模块是否可用。

参数

feature -- 要检查的模块。

返回

如果用则为​True​,否则为 False 。

引发

ValueError -- 如果此版本的pillow中未定义模块。

​PIL.features.version_module(feature)​
参数

feature -- 要检查的模块。

返回

以字符串形式加载的版本号,或 None (如果未知或不可用)。

引发

ValueError -- 如果此版本的枕头中未定义模块。

​PIL.features.get_supported_modules()​
返回

所有支持的模块的列表。