Binary blobs to jpeg

Carsten Haese carsten at
Mon Jul 16 21:06:04 CEST 2007

On Mon, 2007-07-16 at 18:57 +0000, jayharvard1 at wrote:
> Hello All.
> I'm trying to create jpegs out of data that is stored in a binary blob
> format in an RDBMS (MS Access). I've tried writing the jpeg directly:
> while not rs.EOF:
>      op = file(imgdir + "\\" + pic,"w")
>      print >> op, rs.Fields[3].Value
>      ##where rs.Fields[3].Value is the data in the blob from Access.
> When I try to write out this file, the jpeg doesn't turn out.

Have you tried to open the file in "wb" mode? 


Carsten Haese

More information about the Python-list mailing list