Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Fixed bug with creating image directories

Grant Sanderson78b660bb923c
diff --git a/scene/scene.py b/scene/scene.py
index 1a01c4119..fb6df9b48 100644
--- a/scene/scene.py
+++ b/scene/scene.py
@@ -482,8 +482,9 @@ class Scene(object):
def save_image(self, name = None, mode = "RGB", dont_update = False):
path = self.get_image_file_path(name, dont_update)
- if not os.path.exists(path):
- os.makedirs(path)
+ directory_path = os.path.dirname(path)
+ if not os.path.exists(directory_path):
+ os.makedirs(directory_path)
if not dont_update:
self.update_frame()
image = self.get_image()