how to store an image into redis using python / PIL

后端 未结 2 517
后悔当初
后悔当初 2021-02-10 15:12

I\'m using python and the Image module(PIL) to process images.

I want to store the raw bits stream of the image object to redis so that others can directly read the imag

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-10 15:53

    import redis
    r =  redis.StrictRedis()
    img = open("/path/to/img.jpeg","rb").read()
    r.set("bild1",img)
    

    works here too!

提交回复
热议问题