mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 14:44:13 -06:00
Add placeholder thumbnail to package
This kitten really likes boxes of all kinds: Cardboard and plastic boxes for sure, but also digital boxes such as the UFP. Contributes to issue CURA-4872.
This commit is contained in:
parent
8a3a3d32da
commit
8bd351c133
2 changed files with 6 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
from charon.VirtualFile import VirtualFile #To open UFP files.
|
||||
from charon.OpenMode import OpenMode #To indicate that we want to write to UFP files.
|
||||
import os.path #To get the placeholder kitty icon.
|
||||
|
||||
from UM.Mesh.MeshWriter import MeshWriter #The writer we need to implement.
|
||||
from UM.PluginRegistry import PluginRegistry #To get the g-code writer.
|
||||
|
@ -19,4 +20,8 @@ class UFPWriter(MeshWriter):
|
|||
archive.addRelation(target = "/3D/model.gcode", file_type = "http://schemas.ultimaker.org/package/2018/relationships/gcode")
|
||||
|
||||
#Store the thumbnail.
|
||||
#TODO
|
||||
#TODO: Generate the thumbnail image. Below is just a placeholder.
|
||||
archive.addContentType(extension = "png", mime_type = "image/png")
|
||||
thumbnail = archive.getStream("/Metadata/thumbnail.png")
|
||||
thumbnail.write(os.path.join(os.path.basename(__file__), "kitten.png"))
|
||||
archive.addRelation(target = "/Metadata/thumbnail.png", file_type = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail")
|
Loading…
Add table
Add a link
Reference in a new issue