Fix exception being raised when image is None.

This commit is contained in:
Markus Roth
2013-11-08 23:53:39 +01:00
parent 6e58439746
commit 3102f0a27d
+5
View File
@@ -130,6 +130,11 @@ class MainWindow(QMainWindow):
img = self.labeltool.getImage(new_image)
if img == None:
self.controls.setFilename("")
self.selectionmodel.setCurrentIndex(new_image.index(), QItemSelectionModel.ClearAndSelect|QItemSelectionModel.Rows)
return
h = img.shape[0]
w = img.shape[1]
self.image_resolution.setText("%dx%d" % (w, h))