diff options
Diffstat (limited to 'src/py/cam/cam_qt.py')
-rw-r--r-- | src/py/cam/cam_qt.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/py/cam/cam_qt.py b/src/py/cam/cam_qt.py index fb485b9b..45a30aeb 100644 --- a/src/py/cam/cam_qt.py +++ b/src/py/cam/cam_qt.py @@ -87,6 +87,8 @@ def to_rgb(fmt, size, data): w = size[0] h = size[1] + fmt = str(fmt) + if fmt == 'YUYV': # YUV422 yuyv = data.reshape((h, w // 2 * 4)) @@ -293,7 +295,7 @@ class MainWindow(QtWidgets.QWidget): w, h = cfg.size pitch = cfg.stride - if cfg.pixel_format == 'MJPEG': + if str(cfg.pixel_format) == 'MJPEG': img = Image.open(BytesIO(mfb.planes[0])) qim = ImageQt(img).copy() pix = QtGui.QPixmap.fromImage(qim) |