fix base Image attribute references

(cherry picked from commit 07cc74d38b)
This commit is contained in:
nulano 2020-06-22 08:59:57 +02:00
parent 5e4c3ae554
commit 8b005dfe33

View File

@ -260,57 +260,51 @@ Attributes
Instances of the :py:class:`Image` class have the following attributes: Instances of the :py:class:`Image` class have the following attributes:
.. py:attribute:: filename .. py:attribute:: Image.filename
:type: str
The filename or path of the source file. Only images created with the The filename or path of the source file. Only images created with the
factory function ``open`` have a filename attribute. If the input is a factory function ``open`` have a filename attribute. If the input is a
file like object, the filename attribute is set to an empty string. file like object, the filename attribute is set to an empty string.
:type: :py:class:`string` .. py:attribute:: Image.format
:type: Optional[str]
.. py:attribute:: format
The file format of the source file. For images created by the library The file format of the source file. For images created by the library
itself (via a factory function, or by running a method on an existing itself (via a factory function, or by running a method on an existing
image), this attribute is set to ``None``. image), this attribute is set to ``None``.
:type: :py:class:`string` or ``None`` .. py:attribute:: Image.mode
:type: str
.. py:attribute:: mode
Image mode. This is a string specifying the pixel format used by the image. Image mode. This is a string specifying the pixel format used by the image.
Typical values are “1”, “L”, “RGB”, or “CMYK.” See Typical values are “1”, “L”, “RGB”, or “CMYK.” See
:ref:`concept-modes` for a full list. :ref:`concept-modes` for a full list.
:type: :py:class:`string` .. py:attribute:: Image.size
:type: tuple[int]
.. py:attribute:: size
Image size, in pixels. The size is given as a 2-tuple (width, height). Image size, in pixels. The size is given as a 2-tuple (width, height).
:type: ``(width, height)`` .. py:attribute:: Image.width
:type: int
.. py:attribute:: width
Image width, in pixels. Image width, in pixels.
:type: :py:class:`int` .. py:attribute:: Image.height
:type: int
.. py:attribute:: height
Image height, in pixels. Image height, in pixels.
:type: :py:class:`int` .. py:attribute:: Image.palette
:type: Optional[PIL.ImagePalette.ImagePalette]
.. py:attribute:: palette
Colour palette table, if any. If mode is "P" or "PA", this should be an Colour palette table, if any. If mode is "P" or "PA", this should be an
instance of the :py:class:`~PIL.ImagePalette.ImagePalette` class. instance of the :py:class:`~PIL.ImagePalette.ImagePalette` class.
Otherwise, it should be set to ``None``. Otherwise, it should be set to ``None``.
:type: :py:class:`~PIL.ImagePalette.ImagePalette` or ``None`` .. py:attribute:: Image.info
:type: dict
.. py:attribute:: info
A dictionary holding data associated with the image. This dictionary is A dictionary holding data associated with the image. This dictionary is
used by file handlers to pass on various non-image information read from used by file handlers to pass on various non-image information read from
@ -322,5 +316,3 @@ Instances of the :py:class:`Image` class have the following attributes:
keep a reference to the info dictionary returned from the open method. keep a reference to the info dictionary returned from the open method.
Unless noted elsewhere, this dictionary does not affect saving files. Unless noted elsewhere, this dictionary does not affect saving files.
:type: :py:class:`dict`