Thread: Handling images using Python
Hello, I tried to store some images in PostgreSQL using Python via psycopg database adapter. Unfortunately the examples I found in the web very not really the best - I just was not able to get one working. Is there anybody who could give an example how to store an image in a usual format (PNG, JPG, ...) into a simple table and get it back via Python? Kind regards Andreas.
Andreas Tille wrote: > Hello, > > I tried to store some images in PostgreSQL using Python via > psycopg database adapter. Unfortunately the examples I found in > the web very not really the best - I just was not able to get one > working. > > Is there anybody who could give an example how to store an image > in a usual format (PNG, JPG, ...) into a simple table and get > it back via Python? Did you check psycopg's examples/binary.py? It works for me. > > Kind regards > > Andreas. yves