diff --git a/src/picam/picam1.py b/src/picam/picam1.py index f2182ba..6442fa7 100644 --- a/src/picam/picam1.py +++ b/src/picam/picam1.py @@ -36,10 +36,12 @@ class PiCam1(PiCam): def capture(self, preview: bool = False) -> bytearray: # Bytes to hold output buffer - out = bytearray() bytes_stream = BytesIO() - if not preview: + if preview: + out = bytearray(self.preview_resolution[0] * self.preview_resolution[1]) + else: + out = bytearray(self.capture_resolution[0] * self.capture_resolution[1]) # If preview we'll already have the right resolution self.set_camera_resolution(self.capture_resolution)