mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 03:07:53 -06:00
Defensive programming for isometric snapshot.
This commit is contained in:
parent
692b27ce3c
commit
d2db9a2555
1 changed files with 9 additions and 7 deletions
|
@ -113,16 +113,18 @@ class MakerbotWriter(MeshWriter):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
snapshot = Snapshot.isometricSnapshot(width, height)
|
snapshot = Snapshot.isometricSnapshot(width, height)
|
||||||
|
|
||||||
|
thumbnail_buffer = QBuffer()
|
||||||
|
thumbnail_buffer.open(QBuffer.OpenModeFlag.WriteOnly)
|
||||||
|
|
||||||
|
snapshot.save(thumbnail_buffer, "PNG")
|
||||||
|
|
||||||
|
return thumbnail_buffer
|
||||||
|
|
||||||
except:
|
except:
|
||||||
Logger.logException("w", "Failed to create snapshot image")
|
Logger.logException("w", "Failed to create snapshot image")
|
||||||
return
|
|
||||||
|
|
||||||
thumbnail_buffer = QBuffer()
|
return None
|
||||||
thumbnail_buffer.open(QBuffer.OpenModeFlag.WriteOnly)
|
|
||||||
|
|
||||||
snapshot.save(thumbnail_buffer, "PNG")
|
|
||||||
|
|
||||||
return thumbnail_buffer
|
|
||||||
|
|
||||||
def write(self, stream: BufferedIOBase, nodes: List[SceneNode], mode=MeshWriter.OutputMode.BinaryMode) -> bool:
|
def write(self, stream: BufferedIOBase, nodes: List[SceneNode], mode=MeshWriter.OutputMode.BinaryMode) -> bool:
|
||||||
if mode != MeshWriter.OutputMode.BinaryMode:
|
if mode != MeshWriter.OutputMode.BinaryMode:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue