def formatReceived(self, data: bytes):
    image_format = json.loads(data.decode())
    if (image_format['channels'] == 1):
        self._image_shape = (image_format['height'], image_format['width'])
    else:
        self._image_shape = (image_format['height'], image_format['width'], image_format['channels'])
    self._image_colorspace = image_format['colorspace']
def formatReceived(self, data: bytes):
    image_format = json.loads(data.decode())
    if (image_format['channels'] == 1):
        self._image_shape = (image_format['height'], image_format['width'])
    else:
        self._image_shape = (image_format['height'], image_format['width'], image_format['channels'])
    self._image_colorspace = image_format['colorspace']