Skip to content

Commit c409e5c

Browse files
Fix flip_y producing non-contiguous array in load_buffer_data_from_image (#937)
np.flipud returns a view with negative strides, which copy_from_numpy rejects. Ensure the returned array is always C-contiguous. Relates to #928 Made-with: Cursor Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com>
1 parent 3d1d552 commit c409e5c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

slangpy/types/common.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,7 @@ def load_buffer_data_from_image(
6666
if scale != 1.0 or offset != 0.0:
6767
data = data * scale + offset
6868

69+
if not data.flags["C_CONTIGUOUS"]:
70+
data = np.ascontiguousarray(data)
71+
6972
return data

0 commit comments

Comments
 (0)