Merge pull request #19770 from Ultimaker/CURA-12185_add-sketch-thumbnail-sizes

CURA-12185 add sketch thumbnail sizes
This commit is contained in:
HellAholic 2024-10-18 13:43:04 +02:00 committed by GitHub
commit b7587ac9fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -112,15 +112,13 @@ class MakerbotWriter(MeshWriter):
match file_format: match file_format:
case "application/x-makerbot-sketch": case "application/x-makerbot-sketch":
filename, filedata = "print.gcode", gcode_text_io.getvalue() filename, filedata = "print.gcode", gcode_text_io.getvalue()
self._PNG_FORMATS = self._PNG_FORMAT
case "application/x-makerbot": case "application/x-makerbot":
filename, filedata = "print.jsontoolpath", du.gcode_2_miracle_jtp(gcode_text_io.getvalue()) filename, filedata = "print.jsontoolpath", du.gcode_2_miracle_jtp(gcode_text_io.getvalue())
self._PNG_FORMATS = self._PNG_FORMAT + self._PNG_FORMAT_METHOD
case _: case _:
raise Exception("Unsupported Mime type") raise Exception("Unsupported Mime type")
png_files = [] png_files = []
for png_format in self._PNG_FORMATS: for png_format in (self._PNG_FORMAT + self._PNG_FORMAT_METHOD):
width, height, prefix = png_format["width"], png_format["height"], png_format["prefix"] width, height, prefix = png_format["width"], png_format["height"], png_format["prefix"]
thumbnail_buffer = self._createThumbnail(width, height) thumbnail_buffer = self._createThumbnail(width, height)
if thumbnail_buffer is None: if thumbnail_buffer is None: