[Fixed encoding inline images in chat window Adrian Georgescu **20210703161136 Ignore-this: 36026e7dbabebeb4a3b50a070536a51e ] hunk ./blink/chatwindow.py 2 +import base64 hunk ./blink/chatwindow.py 561 - image_data = str(image_reader.device().readAll()) + image_data = image_reader.device().read() hunk ./blink/chatwindow.py 572 - image_data = str(image_buffer.data()) + image_data = image_buffer.data() hunk ./blink/chatwindow.py 755 - self.send_message(image.thumbnail.data, content_type=image.thumbnail.type) + image_data = base64.b64encode(image.thumbnail.data).decode() + self.send_message(image_data, content_type=image.thumbnail.type) hunk ./blink/chatwindow.py 758 - self.add_message(ChatStatus("Error sending image '%s': %s" % (os.path.basename(image.filename), e))) # decide what type to use here. -Dan + self.add_message(ChatStatus("Error sending image '%s': %s" % (os.path.basename(image.filename), str(e)))) # decide what type to use here. -Dan hunk ./blink/chatwindow.py 760 - content = ''''''.format(image.fileurl, image.thumbnail.type, image.thumbnail.data.encode('base64').rstrip()) + content = ''''''.format(image.fileurl, image.thumbnail.type, image_data) hunk ./blink/chatwindow.py 771 - self.send_message(match.group('data').decode('base64'), content_type=match.group('type')) + data = match.group('data') if isinstance(match.group('data'), bytes) else match.group('data').encode() + image_data = base64.b64encode(data).decode() + self.send_message(image_data, content_type=match.group('type')) hunk ./blink/chatwindow.py 775 - self.add_message(ChatStatus('Error sending image: %s' % e)) # decide what type to use here. -Dan + self.add_message(ChatStatus('Error sending image: %s' % str(e)))