From f1ad57b132adee20e7a186ac6ad461d5ad38859c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jani=20=C5=A0umak?= Date: Thu, 13 Jul 2017 22:35:40 +0200 Subject: [PATCH] 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/). --- docs/reference/Image.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/reference/Image.rst b/docs/reference/Image.rst index 3335cb3da..e867494b2 100644 --- a/docs/reference/Image.rst +++ b/docs/reference/Image.rst @@ -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