mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-09 15:43:18 +03:00
Merge pull request #3722 from radarhere/seek_docs
Corrected seek documentation
This commit is contained in:
commit
d1f865e02a
|
@ -105,8 +105,8 @@ Reading sequences
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The GIF loader supports the :py:meth:`~file.seek` and :py:meth:`~file.tell`
|
The GIF loader supports the :py:meth:`~file.seek` and :py:meth:`~file.tell`
|
||||||
methods. You can seek to the next frame (``im.seek(im.tell() + 1)``), or rewind
|
methods. You can combine these methods to seek to the next frame
|
||||||
the file by seeking to the first frame. Random access is not supported.
|
(``im.seek(im.tell() + 1)``).
|
||||||
|
|
||||||
``im.seek()`` raises an ``EOFError`` if you try to seek after the last frame.
|
``im.seek()`` raises an ``EOFError`` if you try to seek after the last frame.
|
||||||
|
|
||||||
|
|
|
@ -396,10 +396,6 @@ Reading sequences
|
||||||
As seen in this example, you’ll get an :py:exc:`EOFError` exception when the
|
As seen in this example, you’ll get an :py:exc:`EOFError` exception when the
|
||||||
sequence ends.
|
sequence ends.
|
||||||
|
|
||||||
Note that most drivers in the current version of the library only allow you to
|
|
||||||
seek to the next frame (as in the above example). To rewind the file, you may
|
|
||||||
have to reopen it.
|
|
||||||
|
|
||||||
The following class lets you use the for-statement to loop over the sequence:
|
The following class lets you use the for-statement to loop over the sequence:
|
||||||
|
|
||||||
Using the ImageSequence Iterator class
|
Using the ImageSequence Iterator class
|
||||||
|
|
|
@ -2005,9 +2005,6 @@ class Image(object):
|
||||||
**EOFError** exception. When a sequence file is opened, the
|
**EOFError** exception. When a sequence file is opened, the
|
||||||
library automatically seeks to frame 0.
|
library automatically seeks to frame 0.
|
||||||
|
|
||||||
Note that in the current version of the library, most sequence
|
|
||||||
formats only allow you to seek to the next frame.
|
|
||||||
|
|
||||||
See :py:meth:`~PIL.Image.Image.tell`.
|
See :py:meth:`~PIL.Image.Image.tell`.
|
||||||
|
|
||||||
:param frame: Frame number, starting at 0.
|
:param frame: Frame number, starting at 0.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user