🚧 Add breaks

For #11
This commit is contained in:
Shikiryu
2023-06-13 01:51:30 +02:00
parent 693c596224
commit 5a83727c39
7 changed files with 100 additions and 15 deletions

View File

@@ -17,6 +17,8 @@ class ImagePlaceholder:
def display_new_image(self):
image_path = self.images[0]
self.images.pop(0)
if image_path == "break":
image_path = 'assets/images/break.gif'
self.current_original_image = Image.open(image_path)
self.current_image = copy.deepcopy(self.current_original_image)
self.apply_options()
@@ -45,6 +47,11 @@ class ImagePlaceholder:
self.resize_image(True)
def load_widget(self):
image_to_display = ImageTk.PhotoImage(self.current_image)
print(self.current_image.format)
if self.current_image.format == "GIF":
print("is gif !")
image_to_display = ImageTk.PhotoImage(self.current_image, format = "gif -index 2")
else:
image_to_display = ImageTk.PhotoImage(self.current_image)
self.image_label.configure(image=image_to_display)
self.image_label.image = image_to_display