diff --git a/displayarray/frame/frame_updater.py b/displayarray/frame/frame_updater.py index 52aa0a8..b76d68a 100644 --- a/displayarray/frame/frame_updater.py +++ b/displayarray/frame/frame_updater.py @@ -54,7 +54,11 @@ class FrameUpdater(threading.Thread): frame_c = c(frame) if frame_c is not None: frame = frame_c - if frame.shape[-1] not in [1, 3] and len(frame.shape) != 2: + if ( + isinstance(frame, np.ndarray) + and frame.shape[-1] not in [1, 3] + and len(frame.shape) != 2 + ): print( f"Too many channels in output. (Got {frame.shape[-1]} instead of 1 or 3.) " f"Frame selection callback added." diff --git a/displayarray/window/subscriber_windows.py b/displayarray/window/subscriber_windows.py index 89c9504..19768cd 100644 --- a/displayarray/window/subscriber_windows.py +++ b/displayarray/window/subscriber_windows.py @@ -146,7 +146,8 @@ class SubscriberWindows(object): if isinstance(self.frames[f], Exception): raise self.frames[f] if ( - self.frames[f].shape[-1] not in [1, 3] + isinstance(self.frames[f], np.ndarray) + and self.frames[f].shape[-1] not in [1, 3] and len(self.frames[f].shape) != 2 ): print(