mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-25 00:34:14 +03:00
document Image.open(formats=...) parameter
This commit is contained in:
parent
2b061b68db
commit
30c4945d9c
|
@ -2851,6 +2851,11 @@ def open(fp, mode="r", formats=None):
|
||||||
``file.seek``, and ``file.tell`` methods,
|
``file.seek``, and ``file.tell`` methods,
|
||||||
and be opened in binary mode.
|
and be opened in binary mode.
|
||||||
:param mode: The mode. If given, this argument must be "r".
|
:param mode: The mode. If given, this argument must be "r".
|
||||||
|
:param formats: A list or tuple of formats to attempt to load the file in.
|
||||||
|
This can be used to restrict the set of formats checked.
|
||||||
|
Pass ``None`` to try all supported formats. You can print the set of
|
||||||
|
available formats by running ``python -m PIL`` or using
|
||||||
|
the :py:func:`PIL.features.pilinfo` function.
|
||||||
:returns: An :py:class:`~PIL.Image.Image` object.
|
:returns: An :py:class:`~PIL.Image.Image` object.
|
||||||
:exception FileNotFoundError: If the file cannot be found.
|
:exception FileNotFoundError: If the file cannot be found.
|
||||||
:exception PIL.UnidentifiedImageError: If the image cannot be opened and
|
:exception PIL.UnidentifiedImageError: If the image cannot be opened and
|
||||||
|
|
Loading…
Reference in New Issue
Block a user