Skip to content

Commit 31802da

Browse files
committed
Added compatibility for PNG
1 parent 9fae5b2 commit 31802da

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/window.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,13 +686,14 @@ def load_image(self, file_dialog, result):
686686
new_width = int((max_size / height) * width)
687687
resized_img = img.resize((new_width, new_height), Image.LANCZOS)
688688
with BytesIO() as output:
689-
resized_img.save(output, format="JPEG")
689+
resized_img.save(output, format="PNG")
690690
image_data = output.getvalue()
691691
self.attached_image["base64"] = base64.b64encode(image_data).decode("utf-8")
692692

693693
self.image_button.set_css_classes(["destructive-action"])
694694
self.image_button.get_child().set_icon_name("edit-delete-symbolic")
695695
except Exception as e:
696+
print(e)
696697
self.show_toast("error", 5, self.main_overlay)
697698

698699
def remove_image(self, dialog, task):

0 commit comments

Comments
 (0)