From f632e3b9ad1163491ae28e1ff74086e8eec0864a Mon Sep 17 00:00:00 2001 From: Pierre Raybaut Date: Tue, 16 Oct 2018 10:53:45 +0200 Subject: vimba_frame.getBufferByteData: fixed image size When pixels are coded on more than one byte, the method was returning a wrongly sized buffer. With one-byte pixels, the error was still there but the result was correct anyway. --- pymba/vimba_frame.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pymba/vimba_frame.py b/pymba/vimba_frame.py index b2b5d35..072aaf8 100644 --- a/pymba/vimba_frame.py +++ b/pymba/vimba_frame.py @@ -159,9 +159,8 @@ class VimbaFrame(object): POINTER(c_ubyte * self.payloadSize)) # make array of c_ubytes from buffer - array = (c_ubyte * int(self.height*self.pixel_bytes) * - int(self.width*self.pixel_bytes)).from_address(addressof( - data.contents)) + imagebytes = int(self.height*self.width*self.pixel_bytes) + array = (c_ubyte*imagebytes).from_address(addressof(data.contents)) return array -- cgit v1.2.3