StringIO MySQL data blob Image problem

dimitri pater dimitri.pater at
Wed Sep 5 21:14:08 CEST 2007

---------- Forwarded message ----------
From: dimitri pater <dimitri.pater at>
Date: Sep 5, 2007 9:13 PM
Subject: Re: StringIO MySQL data blob Image problem
To: Tim Golden <mail at>

> Well, I'm mystified. Not by your results: that exactly what I
> expected to get, but because you're doing everything *except*
> manipulating an image and putting it into a PDF via ReportLab.
Dear Tim,
you are right of course, I have been trying to put the StringIO in a temp file:

and indeed, the blob from MySQL is saved as an image!
foto= Image('temp.jpg')
and inserting foto into a table results in:
x = struct.unpack('B',
error: unpack str size does not match format
oh, well... still needs some work
BTW: I used 'local' images before (I mean they did not originate from
a DB), that worked well in Reportlab's tables.
Thanks, I am getting there (I think)

You can't have everything. Where would you put it? -- Steven Wright
please visit

More information about the Python-list mailing list