This commit is contained in:
wiredfool 2015-10-03 08:29:52 +01:00
parent d965257616
commit 42633d7a31

View File

@ -1623,12 +1623,12 @@ class Image(object):
open_fp = False
if isPath(fp):
filename = fp
open_fp=True
open_fp = True
elif sys.version_info >= (3, 4):
from pathlib import Path
if isinstance(fp, Path):
filename = str(fp.resolve())
open_fp=True
open_fp = True
elif hasattr(fp, "name") and isPath(fp.name):
# only set the name for metadata purposes
filename = fp.name