Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.python
PyCairo, PIL and StringIO
Jair Trejo
1/2/2008 1:15:00 AM
I'm doing some image processing in PIL, and I want to
display the results in a GTK window using PyCairo, so
I create a Cairo image surface from the PIL Image like
this:
mfile = StringIO.StringIO()
final.save(mfile, format="PNG")
ima =
cairo.ImageSurface.create_from_png(mfile)
mfile.close()
return ima
Where final is a PIL image. The problem is, I get a
IOError: error while reading from Input Stream.
¿Any idea of why is this happening? I tried saving to
a temporary file, i.e., replace the above code with:
final.save('final.png')
ima =
cairo.ImageSurface.create_from_png('final.png')
Instead of a StringIO object, and it works just fine.
____________________________________________________________________________________
¡Capacidad ilimitada de almacenamiento en tu correo!
No te preocupes más por el espacio de tu cuenta con Correo Yahoo!:
http://correo.yah...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
PyCairo, PIL and StringIO
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password