Skip to content

Commit 1aebd1a

Browse files
committedNov 10, 2016
closes #7
1 parent 2ce01a1 commit 1aebd1a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎src/resources/scripts/detect.py

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
laserdistparam = sys.argv[2]
1414

1515
img = imread(imgfile)
16+
if not len(img.shape):
17+
print json.dumps({
18+
"error": True,
19+
"message": "Could not load image. The image file might be corrupt.",
20+
})
21+
exit(1)
1622
img[:, 0:int(img.shape[1] * 0.15), :] = 0
1723
img[:, int(img.shape[1] - img.shape[1] * 0.15):, :] = 0
1824

0 commit comments

Comments
 (0)