mirror of
https://github.com/wassname/sloth.git
synced 2026-07-26 13:38:05 +08:00
Fix exception being raised when image is None.
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user