I've been searching quite some time but did not succeed. In my little python3.6 application I am reading an image from a sqlite database, writing it to a png file
cur = self.con.cursor()
cur.execute('SELECT image FROM image WHERE id IS ?', str(uid))
image = cur.fetchone()[0]
fout = open('temp.png', 'wb')
fout.write(image)
fout.close()
only to read it back in to be displayed using
self.preview.set_from_file('temp.png')
where preview is a GtkImage created with
self.preview = builder.get_object('preview')
Is there a way to skip the writing to disk? I would much rather like to display the image straight from the db.
Thanks in advance.