@@ -258,13 +258,12 @@ namespace {
258258 delete[] reinterpret_cast <T*>(p);
259259 });
260260 if (dims == 4 ) {
261- return py::cast (
262- py::ndarray<py::numpy, T>(
263- mem, { depth, height, width, chans }, owner,
264- { py::ssize_t (height * width * chans),
265- py::ssize_t (width * chans), py::ssize_t (chans),
266- py::ssize_t (1 ) }),
267- py::rv_policy::move);
261+ return py::cast (py::ndarray<py::numpy, T>(
262+ mem, { depth, height, width, chans }, owner,
263+ { py::ssize_t (height * width * chans),
264+ py::ssize_t (width * chans),
265+ py::ssize_t (chans), py::ssize_t (1 ) }),
266+ py::rv_policy::move);
268267 }
269268 if (dims == 3 && depth == 1 ) {
270269 return py::cast (py::ndarray<py::numpy, T>(
@@ -274,11 +273,11 @@ namespace {
274273 py::rv_policy::move);
275274 }
276275 if (dims == 2 && depth == 1 && height == 1 ) {
277- return py::cast (
278- py::ndarray<py::numpy, T>(mem, { width, chans }, owner,
279- { py::ssize_t (chans),
280- py::ssize_t (1 ) }),
281- py::rv_policy::move);
276+ return py::cast (py::ndarray<py::numpy, T>(mem, { width, chans },
277+ owner,
278+ { py::ssize_t (chans),
279+ py::ssize_t (1 ) }),
280+ py::rv_policy::move);
282281 }
283282 return oiio_py::make_numpy_array (mem, size);
284283#else
0 commit comments