mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-26 20:13:40 +03:00
spaces.
This commit is contained in:
parent
d965257616
commit
42633d7a31
|
@ -1623,12 +1623,12 @@ class Image(object):
|
||||||
open_fp = False
|
open_fp = False
|
||||||
if isPath(fp):
|
if isPath(fp):
|
||||||
filename = fp
|
filename = fp
|
||||||
open_fp=True
|
open_fp = True
|
||||||
elif sys.version_info >= (3, 4):
|
elif sys.version_info >= (3, 4):
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
if isinstance(fp, Path):
|
if isinstance(fp, Path):
|
||||||
filename = str(fp.resolve())
|
filename = str(fp.resolve())
|
||||||
open_fp=True
|
open_fp = True
|
||||||
elif hasattr(fp, "name") and isPath(fp.name):
|
elif hasattr(fp, "name") and isPath(fp.name):
|
||||||
# only set the name for metadata purposes
|
# only set the name for metadata purposes
|
||||||
filename = fp.name
|
filename = fp.name
|
||||||
|
|
Loading…
Reference in New Issue
Block a user