Skip to content

Commit 777645e

Browse files
committed
deal with alternate np.int type in Image
1 parent df42f77 commit 777645e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sources/fmask.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,11 @@ static PyObject *fmask_func(PyObject *self, PyObject *args) {
137137
if (PyArray_DESCR(TA)->type_num != NPY_DOUBLE ||
138138
PyArray_NDIM(TA) != 1)
139139
return makeTypeException("Arg 2 (TA): expected 1-dimensional array of type np.float64 w/stride 1.");
140-
if (PyArray_DESCR(image)->type_num != NPY_INT32 ||
140+
// in Windows the type might be INT which is the same as INT32
141+
if ((PyArray_DESCR(image)->type_num != NPY_INT &&
142+
PyArray_DESCR(image)->type_num != NPY_INT32) ||
141143
PyArray_NDIM(image) != 1)
142-
return makeTypeException("Arg 3 (image): expected 1-dimensional array of type np.float64 w/stride 1.");
144+
return makeTypeException("Arg 3 (image): expected 1-dimensional array of type np.int32 w/stride 1.");
143145
if (PyArray_DESCR(TThs)->type_num != NPY_DOUBLE ||
144146
PyArray_NDIM(TThs) != 1)
145147
return makeTypeException("Arg 4 (TThs): expected 1-dimensional array of type np.float64 w/stride 1.");

0 commit comments

Comments
 (0)