Altered descriptions [ci skip]

This commit is contained in:
Andrew Murray 2020-07-05 21:47:23 +10:00 committed by nulano
parent 74899cd6cf
commit 91bd2d3752

View File

@ -333,15 +333,14 @@ Instances of the :py:class:`Image` class have the following attributes:
.. py:attribute:: Image.is_animated .. py:attribute:: Image.is_animated
:type: bool :type: bool
This attribute is ``True`` if the Image is animated, ``False`` otherwise. ``True`` if this image has more than one frame, or ``False`` otherwise.
Typically defined as ``Image.n_frames > 1``.
This attribute is only defined by Image plugins that support animated Images. This attribute is only defined by image plugins that support animated images.
Plugins may leave this attribute undefined if they don't support loading Plugins may leave this attribute undefined if they don't support loading
animated images, even if the given format supports animated images. Use animated images, even if the given format supports animated images.
``hasattr(image, "is_animated")`` to check whether the implementation
supports animated images, or ``getattr(image, "is_animated", False)`` To check whether an image is animated regardless of its format, use
to check whether an image has been loaded with animation support. ``getattr(image, "is_animated", False)``.
.. seealso:: :attr:`~Image.n_frames`, :func:`~Image.seek` and :func:`~Image.tell` .. seealso:: :attr:`~Image.n_frames`, :func:`~Image.seek` and :func:`~Image.tell`
@ -349,15 +348,13 @@ Instances of the :py:class:`Image` class have the following attributes:
:type: int :type: int
The number of frames in this image. The number of frames in this image.
Defined if and only if :attr:`~Image.is_animated` is also defined.
Equal to 1 for non-animated images loaded by a plugin supporting animations.
This attribute is only defined by Image plugins that support animated Images. This attribute is only defined by image plugins that support animated images.
Plugins may leave this attribute undefined if they don't support loading Plugins may leave this attribute undefined if they don't support loading
animated images, even if the given format supports animated images. Use animated images, even if the given format supports animated images.
``hasattr(image, "is_animated")`` to check whether the implementation
supports animated images, or ``getattr(image, "n_frames", 1)`` To check the number of frames in an image regardless of its format, use
to check whether an image has been loaded with more than one frame. ``getattr(image, "n_frames", 1)``.
.. seealso:: :attr:`~Image.is_animated`, :func:`~Image.seek` and :func:`~Image.tell` .. seealso:: :attr:`~Image.is_animated`, :func:`~Image.seek` and :func:`~Image.tell`