how to store an image into redis using python / PIL

后端 未结 2 492
说谎
说谎 2021-02-10 15:16

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:51

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

    works here too!

提交回复
热议问题