python gir / Gtk.Image: why does it corrupt my image?



I'm working with an external api which returns an Gtk.Image object. I'm
trying to write that Gtk.Image to a file. To illustrate the problem I've
created the following code:

http://paste.ubuntu.com/830507/

The file gets written to disk but is corrupted. Why is it corrupted? If
I open it with the Gnome image viewer I get one of these messages:

  - Fatal error reading PNG image file: [08][08][08][DB]: invalid chunk
type
  - BMP image has unsupported header size

pixbuf.savev() seems to work but I'd rather write it to a file
descriptor so I can use cStringIO and stream that to urllib.

Regards,
Leon



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]