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

Skip to content

Commit 2636978

Browse files
committed
Merge pull request #4 from mdboom/fix-gdk-strides
Fix _backend_gdk.c
2 parents 8f4ba0d + 094666d commit 2636978

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/_backend_gdk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ pixbuf_get_pixels_array(PyObject *self, PyObject *args)
4343
array = (PyArrayObject*)
4444
PyArray_New(&PyArray_Type, 3, dims, NPY_UBYTE, strides,
4545
(void*)gdk_pixbuf_get_pixels(gdk_pixbuf), 1,
46-
0, NULL);
46+
NPY_ARRAY_WRITEABLE, NULL);
4747

4848
if (array == NULL)
4949
return NULL;
5050

5151
/* the array holds a ref to the pixbuf pixels through this wrapper*/
5252
Py_INCREF(py_pixbuf);
53-
array->base = (PyObject *)py_pixbuf;
53+
PyArray_SetBaseObject(array, (PyObject *)py_pixbuf);
5454
return PyArray_Return(array);
5555
}
5656

0 commit comments

Comments
 (0)