[pygtk] Help with pygtk save_to_callback

Michael Urban pantheraleo at animail.net
Wed Mar 29 16:41:29 WST 2006


Hi all,

I need some help using the pixbuf safe_to_callback method. Basically, what I need to do is take a pixbuf, and save it to an in memory buffer in jpg format that I can dump to a db. I'm running into two main problems:

1: The callback seems to get called multiple times. So calling pixbuf.save_to_callback apparently doesn't pass all of the buffer in one call, but make several calls to the callback.

2: Simply trying to append onto the end of a buffer that you build incrementally does not work. It causes a gobject.GError write function failed.

Can anyone give me a simple example of how I would write a callback function for pixbuf.save_to_callback that would build an in memory buffer that stores the image in the given file type?

Thanks in advance for any help.


More than 300,000 seals could be killed in Canada this year - most of 
them babies. Tell Canada's Prime Minister to stop the hunt now! 
http://go.care2.com/stophunt


http://www.Care2.com  Free e-mail. 100MB storage.  Helps nonprofits. 


More information about the pygtk mailing list