GNOME Bugzilla – Bug 309469
No wrappers for GdkPixdata
Last modified: 2006-07-04 13:44:52 UTC
There doesn't appear to be a wrapper for gdk_pixdata_deserialize making it fairly difficult to (de)serialize pixbufs.
There are no wrappers for GdkPixdata, period, not just deserialize. Changing the title...
Note that the pixdata routines are not actually that useful from Python. There are two types of pixdata blocks you can create with two different uses: 1) uncompressed pixel data. This is used in libraries like GTK. The GdkPixbufs created from such pixdata use the data from the readonly section of the executable, which is shared between all apps using the library. 2) compressed pixel data. The created GdkPixbufs copy the pixel data when decompressing it, but the source data gets loaded along with the executable as readonly data. Can be useful for toy programs where you only want to have a single file. With a Python program, any strings in a .py file are going to be copied when the module is loaded, and hence not shared. This kills off the benefit of (1). Case (2) is also less relevant to Python programs since it is very common for them to come as more than one file anyway.
well, I'm convinced we don't need this. Tommi, can I close this WONTFIX? In any case, there's no time for 2.8 API freeze...
You might also want to (de)serialize pixbufs to disk, socket, whatnot. (I was trying to access f-spot database where for whatever reason thumbnails are in serialized format.) There are more cases where you can have image data in RGB(A) format ready to be used as GdkPixbuf pixel data, but in python there doesn't seem to be any way to do that. The memory/performance benefits might not be as relevant in Python, I was more concerned about not having (de)serialization support at all.
Reopening as comment was made.
GdkPixbuf has plenty of serialization support without GdkPixData: PNG, GIF, BMP, etc. f-spot is the one that needs to be fixed to not save files in a non-standard image format for no good reason; in fact, saving in PNG or JPEG would even save lots of disk space. Unless there is a good argument for GdkPixData (i have no idea why this C API was ever created), I'd rather WONTFIX this.