Skip to content

Commit

Permalink
Merge pull request #7097 from radarhere/seek
Browse files Browse the repository at this point in the history
`Image.open()` seeks to the start of file objects
  • Loading branch information
hugovk committed Jun 29, 2023
2 parents a662fb6 + cc84ff5 commit 1174a9e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PIL/Image.py
Expand Up @@ -3170,7 +3170,8 @@ def open(fp, mode="r", formats=None):
:param fp: A filename (string), pathlib.Path object or a file object.
The file object must implement ``file.read``,
``file.seek``, and ``file.tell`` methods,
and be opened in binary mode.
and be opened in binary mode. The file object will also seek to zero
before reading.
: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.
Expand Down

0 comments on commit 1174a9e

Please sign in to comment.