When loading CELayoutEditorII with a non-existing BG image saved when last quitting the app (like, after renaming mybg.png to mybackground.png), CELayoutEditorII will crash upon startup due to this check in CEGUIOutputWidget.setBackgroundImage (qtwidgets.py):
Code: Select all
if image.isNull():
raise IOError("Failed to create QImage from %s" % filename)
If someone has the same issue and need a quick fix, here's a trivial candidate (which may be improved by asking the user for another image to use):
Code: Select all
def setBackgroundImage(self, filename):
if filename:
image = QImage(filename)
if image.isNull():
QMessageBox.warning(self, "CELayoutEditorII", "Can't load background image: " + filename)
self._unloadBackgroundImage()
if filename and not image.isNull():
self._bkImageTexture = self.bindTexture(image)
self._bkImageFilename = filename
Relevant Hg shelve:
Code: Select all
diff --git a/layouteditor/qtwidgets.py b/layouteditor/qtwidgets.py
--- a/layouteditor/qtwidgets.py
+++ b/layouteditor/qtwidgets.py
@@ -387,7 +387,7 @@
image = QImage(filename)
if image.isNull():
- raise IOError("Failed to create QImage from %s" % filename)
+ QMessageBox.warning(self, "CELayoutEditorII", "Can't load background image: " + filename)
self._unloadBackgroundImage()