Fixed bug in Image error handling
@@ -45,14 +45,13 @@ class ImageInterface(GridInterface):
data = data[:, ::-1]
if inverty:
data = data[::-1, :]
-
expected = (len(ys), len(xs))
shape = data.shape[:2]
error = DataError if len(shape) > 1 else ValueError
if shape != expected and not (not expected and shape == (1,)):
raise error('Key dimension values and value array %s '
'shapes do not match. Expected shape %s, '
- 'actual shape: %s' % (vdim, expected, shape), cls)
+ 'actual shape: %s' % (vdims[0], expected, shape), cls)
if not isinstance(data, np.ndarray) or data.ndim not in [2, 3]:
raise ValueError('ImageInterface expects a 2D array.')
