After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 696917 - Add gdk_pixbuf_loader_write_bytes()
Add gdk_pixbuf_loader_write_bytes()
Status: RESOLVED FIXED
Product: gdk-pixbuf
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gdk-pixbuf-maint
gdk-pixbuf-maint
Depends on:
Blocks:
 
 
Reported: 2013-03-30 17:51 UTC by Emmanuele Bassi (:ebassi)
Modified: 2013-03-30 19:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
loader: Add gdk_pixbuf_loader_write_bytes() (3.52 KB, patch)
2013-03-30 17:51 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review
simple test case (753 bytes, text/plain)
2013-03-30 17:55 UTC, Emmanuele Bassi (:ebassi)
  Details

Description Emmanuele Bassi (:ebassi) 2013-03-30 17:51:33 UTC
Currently, it's impossible to use GInputStream.read() and read_async() with GdkPixbufLoader from a language binding using introspection. We added the read_bytes() and read_bytes_async() variants exactly for this use case, but GBytes.get_data() is currently not introspectable because of the gconstpointer return value. While we wait for a solution for that, we should have enough API to make GdkPixbufLoader work.
Comment 1 Emmanuele Bassi (:ebassi) 2013-03-30 17:51:35 UTC
Created attachment 240173 [details] [review]
loader: Add gdk_pixbuf_loader_write_bytes()

A GBytes variant to gdk_pixbuf_loader_write(), which allows language
bindings to actually be able to use the Gio GInputStream.read_bytes()
method with GdkPixbufLoader.
Comment 2 Emmanuele Bassi (:ebassi) 2013-03-30 17:55:39 UTC
Created attachment 240174 [details]
simple test case

this test shows how to use GdkPixbufLoader.write_bytes() with GInputStream.read_bytes() from python.
Comment 3 Matthias Clasen 2013-03-30 18:13:55 UTC
Review of attachment 240173 [details] [review]:

Sure, looks fine to me - just add it to the docs as well
Comment 4 Emmanuele Bassi (:ebassi) 2013-03-30 19:18:58 UTC
Attachment 240173 [details] pushed as 7e5ee66 - loader: Add gdk_pixbuf_loader_write_bytes()

thanks, pushed to master.

I also branched before the commit, and created the gdk-pixbuf-2-28 branch.