1
0
mirror of synced 2024-11-24 06:20:12 +01:00

Attempt to fix issue with OSX.

This commit is contained in:
Jennifer Taylor 2021-06-12 18:50:17 +00:00
parent 535a2c872e
commit dfffe80a74

View File

@ -643,8 +643,12 @@ def render_path(
)
)
if len(images) > 0:
dirof = os.path.dirname(output)
os.makedirs(dirof, exist_ok=True)
try:
dirof = os.path.dirname(os.path.abspath(output))
os.makedirs(dirof, exist_ok=True)
except FileNotFoundError:
# Apparently on OSX this is possible?
pass
with open(output, "wb") as bfp:
images[0].save(bfp, format=fmt, save_all=True, append_images=images[1:], duration=duration, optimize=True)
@ -673,8 +677,12 @@ def render_path(
):
fullname = f"{filename}-{i:{digits}}{ext}"
dirof = os.path.dirname(fullname)
os.makedirs(dirof, exist_ok=True)
try:
dirof = os.path.dirname(os.path.abspath(fullname))
os.makedirs(dirof, exist_ok=True)
except FileNotFoundError:
# Apparently on OSX this is possible?
pass
with open(fullname, "wb") as bfp:
img.save(bfp, format=fmt)