diff --git a/bemani/utils/afputils.py b/bemani/utils/afputils.py index 5296799..0b0b2ca 100644 --- a/bemani/utils/afputils.py +++ b/bemani/utils/afputils.py @@ -643,6 +643,9 @@ def render_path( ) ) if len(images) > 0: + dirof = os.path.dirname(output) + os.makedirs(dirof, exist_ok=True) + with open(output, "wb") as bfp: images[0].save(bfp, format=fmt, save_all=True, append_images=images[1:], duration=duration, optimize=True) @@ -670,6 +673,9 @@ def render_path( ): fullname = f"{filename}-{i:{digits}}{ext}" + dirof = os.path.dirname(fullname) + os.makedirs(dirof, exist_ok=True) + with open(fullname, "wb") as bfp: img.save(bfp, format=fmt)