Binary blobs to jpeg

Carsten Haese carsten at uniqsys.com
Mon Jul 16 15:06:04 EDT 2007


On Mon, 2007-07-16 at 18:57 +0000, jayharvard1 at gmail.com 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? 

HTH,

-- 
Carsten Haese
http://informixdb.sourceforge.net





More information about the Python-list mailing list