From 8d2e72a10928426b8e8b903011714fb6e25bf5d1 Mon Sep 17 00:00:00 2001 From: Saumya Jain Date: Wed, 28 Feb 2024 14:31:51 +0100 Subject: [PATCH] adding logo for cura project CURA-11403 --- plugins/3MFWriter/ThreeMFWriter.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/3MFWriter/ThreeMFWriter.py b/plugins/3MFWriter/ThreeMFWriter.py index f1f0e08741..5583059a2f 100644 --- a/plugins/3MFWriter/ThreeMFWriter.py +++ b/plugins/3MFWriter/ThreeMFWriter.py @@ -175,9 +175,9 @@ class ThreeMFWriter(MeshWriter): def getArchive(self): return self._archive - def _addShareLogoToThumbnail(self, primary_image): + def _addLogoToThumbnail(self, primary_image, logo_name): # Load the icon png image - icon_image = QImage(Resources.getPath(Resources.Images, "cura-share.png")) + icon_image = QImage(Resources.getPath(Resources.Images, logo_name)) # Resize icon_image to be 1/4 of primary_image size new_width = int(primary_image.width() / 4) @@ -217,7 +217,9 @@ class ThreeMFWriter(MeshWriter): snapshot = self._createSnapshot() if snapshot: if export_settings_model != None: - self._addShareLogoToThumbnail(snapshot) + self._addLogoToThumbnail(snapshot, "cura-share.png") + elif export_settings_model == None and self._store_archive: + self._addLogoToThumbnail(snapshot, "cura-icon.png") thumbnail_buffer = QBuffer() thumbnail_buffer.open(QBuffer.OpenModeFlag.ReadWrite) snapshot.save(thumbnail_buffer, "PNG")