Skip to content

Commit

Permalink
Fix regression error (buffer too small when acquiring)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefsmeets committed Jul 1, 2020
1 parent ff83e09 commit 3e9c23c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions instamatic/camera/camera_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,17 @@ def _eval_dct(self, dct):
"""Takes approximately 0.2-0.3 ms per call if HOST=='localhost'."""
self.s.send(dumper(dct))

response = self.s.recv(self._bufsize)
acquiring_image = dct['attr_name'] == 'getImage'

if acquiring_image and not self.use_shared_memory:
response = self.s.recv(self._imagebufsize)
else:
response = self.s.recv(self._bufsize)

if response:
status, data = loader(response)

if self.use_shared_memory:
if dct['attr_name'] == 'getImage':
if self.use_shared_memory and acquiring_image:
data = self.get_data_from_shared_memory(**data)

if status == 200:
Expand Down

0 comments on commit 3e9c23c

Please sign in to comment.