Have image mobject remember the filepath to the Image

This commit is contained in:
Grant Sanderson 2021-10-15 12:08:30 -07:00
parent 7732d2f0ee
commit 6cdbe0d67a

View file

@ -22,10 +22,13 @@ class ImageMobject(Mobject):
}
def __init__(self, filename, **kwargs):
path = get_full_raster_image_path(filename)
self.set_image_path(get_full_raster_image_path(filename))
super().__init__(**kwargs)
def set_image_path(self, path):
self.path = path
self.image = Image.open(path)
self.texture_paths = {"Texture": path}
super().__init__(**kwargs)
def init_data(self):
self.data = {