On Fri, 1 Jun 2001, [iso-8859-1] Max M�ller Rasmussen wrote:
From: Jerome Alet [mailto:alet@unice.fr]
import PIL.Image
I'm really not sure about the two first parameters that the PIL.Image.fromstring() function need, the first one is the mode, the second is the size.
What about something in these lines (untested)?
logo = getattr(self, "logo") from StringIO import StringIO fromZope = StringIO() # tempfile in memory fromZope.write(logo.data) # save the data from Zope MyPILImage = PIL.Image.open(fromZope)
We mustn't use this line:
fromZope.close()
It works ONLY if I don't close fromZope, otherwise MyPILImage is unuseable because PIL seems to use the provided file id, not duplicate it in some way. THANKS FOR ALL ! [OT] do you know why my transparent GIF appears with a pink background on screen and paper when printed through ReportLab ? I've already noticed this problem but can't explain it. bye, and thanks again Jerome Alet