Is it possible to get the filename of an Image I have already opened from an Image object? I checked the API, and the best I could come up with was the PIL.Image.info, but that appears to be empty when I check it. Is there something else I can use to get this info in the PIL Image library?
(Yes, I realize I can pass the filename into the function. I am looking for another way to do this.)
i.e.
from PIL import Image
def foo_img(img_input):
filename = img_input.info["filename"]
# I want this to print '/path/to/some/img.img'
print(filename)
foo_img(Image.open('/path/to/some/img.img'))