Saturday, May 25, 2013

how to store a image into redis using python / PIL - Stack Overflow

how to store a image into redis using python / PIL - Stack Overflow: "import Image
import redis
import StringIO

output = StringIO.StringIO()
im = Image.open("/home/cwgem/Pictures/portrait.png")
im.save(output, format=im.format)

r = redis.StrictRedis(host='localhost')
r.set('imagedata', output.getvalue())
output.close()"

'via Blog this'