How to get the file name of a PIL image?

Viewed 526
from PIL import Image

img = Image.open("pic_1.png")
print(img.filename) #pic_1.png
#actual outcome:
#AttributeError: 'Image' object has no attribute 'get_filename'

I'm working on Python 3.8.

0 Answers
Related