Add test case for invalid image dimensions

This commit is contained in:
Johannes Schönberger
2013-11-22 11:59:07 +01:00
parent d659cdc6b0
commit 396b686bab
2 changed files with 9 additions and 3 deletions
+2 -2
View File
@@ -1025,8 +1025,8 @@ def warp(image, inverse_map=None, map_args={}, output_shape=None, order=1,
'the `inverse_map` parameter.')
inverse_map = reverse_map
if image.ndim < 2:
raise ValueError("Input must have more than 1 dimension.")
if image.ndim < 2 or image.ndim > 3:
raise ValueError("Input must have 2 or 3 dimensions.")
orig_ndim = image.ndim
image = np.atleast_3d(img_as_float(image))