Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ce7afe1

Browse files
committed
Be explicit with array dimension types
1 parent 88d08db commit ce7afe1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/_image_wrapper.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const char* image_resample__doc__ =
5151

5252

5353
static pybind11::array_t<double> _get_transform_mesh(const pybind11::object& transform,
54-
const ssize_t *dims)
54+
const pybind11::ssize_t *dims)
5555
{
5656
/* TODO: Could we get away with float, rather than double, arrays here? */
5757

@@ -62,7 +62,8 @@ static pybind11::array_t<double> _get_transform_mesh(const pybind11::object& tra
6262
// If attribute doesn't exist, raises Python AttributeError
6363
auto inverse = transform.attr("inverted")();
6464

65-
pybind11::array_t<double> input_mesh({dims[0]*dims[1], 2L});
65+
pybind11::ssize_t mesh_dims[2] = {dims[0]*dims[2], 2};
66+
pybind11::array_t<double> input_mesh(mesh_dims);
6667
auto p = input_mesh.mutable_data();
6768

6869
for (auto y = 0; y < dims[0]; ++y) {

0 commit comments

Comments
 (0)