Skip to content

Commit a2c3235

Browse files
committed
conv: qt: Make sure we provide a contiguous array to QImage
The earlier check did the job, but it wasn't quite correct either. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
1 parent 11886ad commit a2c3235

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

pixutils/conv/qt.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414

1515

1616
def bgr888_to_pix(rgb: npt.NDArray[np.uint8]) -> QtGui.QPixmap:
17-
# QImage doesn't seem to like a numpy view
18-
if rgb.base is not None:
19-
rgb = rgb.copy()
17+
# Make sure we provide a contiguous array to QImage
18+
rgb = np.ascontiguousarray(rgb)
2019

2120
w = rgb.shape[1]
2221
h = rgb.shape[0]

0 commit comments

Comments
 (0)