@@ -298,7 +298,11 @@ def getmodebands(mode):
298298
299299
300300def preinit ():
301- """Explicitly load standard file format drivers."""
301+ """
302+ Explicitly loads BMP, GIF, JPEG, PPM and PPM file format drivers.
303+
304+ It is called when opening or saving images.
305+ """
302306
303307 global _initialized
304308 if _initialized >= 1 :
@@ -334,11 +338,6 @@ def preinit():
334338 assert PngImagePlugin
335339 except ImportError :
336340 pass
337- # try:
338- # import TiffImagePlugin
339- # assert TiffImagePlugin
340- # except ImportError:
341- # pass
342341
343342 _initialized = 1
344343
@@ -347,6 +346,9 @@ def init():
347346 """
348347 Explicitly initializes the Python Imaging Library. This function
349348 loads all available file format drivers.
349+
350+ It is called when opening or saving images if :py:meth:`~preinit()` is
351+ insufficient, and by :py:meth:`~PIL.features.pilinfo`.
350352 """
351353
352354 global _initialized
@@ -3407,8 +3409,12 @@ def register_open(id, factory, accept=None):
34073409
34083410def register_mime (id , mimetype ):
34093411 """
3410- Registers an image MIME type. This function should not be used
3411- in application code.
3412+ Registers an image MIME type by populating ``Image.MIME``. This function
3413+ should not be used in application code.
3414+
3415+ ``Image.MIME`` provides a mapping from image format identifiers to mime
3416+ formats, but :py:meth:`~PIL.ImageFile.ImageFile.get_format_mimetype` can
3417+ provide a different result for specific images.
34123418
34133419 :param id: An image format identifier.
34143420 :param mimetype: The image MIME type for this format.
0 commit comments