mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 01:04:29 +03:00
Improved init() and preinit() documentation
This commit is contained in:
parent
fce23ddce8
commit
cee8fd0788
|
@ -93,10 +93,14 @@ Generating images
|
||||||
Registering plugins
|
Registering plugins
|
||||||
^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. autofunction:: preinit
|
||||||
|
.. autofunction:: init
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
These functions are for use by plugin authors. Application authors can
|
These functions are for use by plugin authors. They are called when a
|
||||||
ignore them.
|
plugin is loaded as part of :py:meth:`~preinit()` or :py:meth:`~init()`.
|
||||||
|
Application authors can ignore them.
|
||||||
|
|
||||||
.. autofunction:: register_open
|
.. autofunction:: register_open
|
||||||
.. autofunction:: register_mime
|
.. autofunction:: register_mime
|
||||||
|
|
|
@ -298,7 +298,11 @@ _initialized = 0
|
||||||
|
|
||||||
|
|
||||||
def preinit():
|
def preinit():
|
||||||
"""Explicitly load standard file format drivers."""
|
"""
|
||||||
|
Explicitly loads BMP, GIF, JPEG, PPM and PPM file format drivers.
|
||||||
|
|
||||||
|
It is called when opening or saving images.
|
||||||
|
"""
|
||||||
|
|
||||||
global _initialized
|
global _initialized
|
||||||
if _initialized >= 1:
|
if _initialized >= 1:
|
||||||
|
@ -334,11 +338,6 @@ def preinit():
|
||||||
assert PngImagePlugin
|
assert PngImagePlugin
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
# try:
|
|
||||||
# import TiffImagePlugin
|
|
||||||
# assert TiffImagePlugin
|
|
||||||
# except ImportError:
|
|
||||||
# pass
|
|
||||||
|
|
||||||
_initialized = 1
|
_initialized = 1
|
||||||
|
|
||||||
|
@ -347,6 +346,9 @@ def init():
|
||||||
"""
|
"""
|
||||||
Explicitly initializes the Python Imaging Library. This function
|
Explicitly initializes the Python Imaging Library. This function
|
||||||
loads all available file format drivers.
|
loads all available file format drivers.
|
||||||
|
|
||||||
|
It is called when opening or saving images if :py:meth:`~preinit()` is
|
||||||
|
insufficient, and by :py:meth:`~PIL.features.pilinfo`.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
global _initialized
|
global _initialized
|
||||||
|
|
Loading…
Reference in New Issue
Block a user