Skip to content

Commit 92d7f53

Browse files
committed
Make sure to check for unsupported combinations of encoding.
Signed-off-by: Chris Lalancette <[email protected]>
1 parent abce77c commit 92d7f53

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

image_tools_py/src/cam2image_py.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,15 @@ def mat2encoding(frame):
5353
encoding += 'bgr'
5454
elif frame.shape[2] == 4:
5555
encoding += 'rgba'
56+
else:
57+
raise Exception("Unsupported frame shape %d" % (frame.shape[2]))
5658

5759
if frame.dtype == 'uint8':
5860
encoding += '8'
5961
elif frame.dtype == 'int16':
6062
encoding += '16'
63+
else:
64+
raise Exception("Unsupported frame type " + frame.dtype)
6165

6266
return encoding
6367

0 commit comments

Comments
 (0)