mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Added the description of the filename attribute to images.rst
Images created with `open` have a filename attribute, but the documentation does not mention it. This lead to a short, but interesting discussion on [Stackoverflow](https://stackoverflow.com/questions/45087638/get-image-filename-from-image-pil/).
This commit is contained in:
parent
b1d0965c75
commit
f8fb58f925
|
@ -165,6 +165,14 @@ Attributes
|
|||
|
||||
Instances of the :py:class:`Image` class have the following attributes:
|
||||
|
||||
.. py:attribute:: filename
|
||||
|
||||
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
|
||||
file like object, the filename attribute is set to an empty string.
|
||||
|
||||
:type: :py:class: `string`
|
||||
|
||||
.. py:attribute:: format
|
||||
|
||||
The file format of the source file. For images created by the library
|
||||
|
|
Loading…
Reference in New Issue
Block a user