From 30c4945d9c7caf5481b22d22bf665dd92aad3164 Mon Sep 17 00:00:00 2001 From: nulano Date: Mon, 3 Aug 2020 00:38:59 +0200 Subject: [PATCH] document Image.open(formats=...) parameter --- src/PIL/Image.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 96a4f6319..49e676a29 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -2851,6 +2851,11 @@ def open(fp, mode="r", formats=None): ``file.seek``, and ``file.tell`` methods, and be opened in binary mode. :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. :exception FileNotFoundError: If the file cannot be found. :exception PIL.UnidentifiedImageError: If the image cannot be opened and