I’m having issues creating a QImage from a base64 string that has been compressed using qCompress. I’ve looked around a lot and can’t seem to find any examples anyone using qUncompress. Python is not my forte in any way, so I apologize if this is a simple question.
Here is my code snippet
def decode_thumbnail(str_image): bytearray = QtCore.QByteArray.fromBase64(str_image) bytearray = QtCore.qUncompress(bytearray) image = QtGui.QImage() image.fromData(bytearray, 'PNG') return image
If someone could give me some pointers that would be great! Thanks!