On Wed, Feb 11, 2004 at 02:34:32PM -0600, John Hunter wrote:
I use pixbuf.save(fname, 'png') to write PNGs to file fname. I would like to have the option to write to stdout, but I get an error when I pass in a file instance, eg, sys.stdout or file(fname, 'w'). This is not too surprising and is consistent with the documentation, but I was wondering if there is any known way to write a pixbuf as PNG to a file-like object, eg stdout.
Can't you produce a string from the pixbuf? If so, it would be a matter of open()ing a file and write()ing to it..
Producing a string from a pixbuf (in PNG format) is coverred here: http://bugzilla.gnome.org/show_bug.cgi?id=82203
This patch will be part of GTK+-2.4. Until then the only way to get a pixbuf in a string is to use a temporary file.
-- Tim Evans Applied Research Associates NZ http://www.aranz.com/ _______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
