I have a Ruby string containing an image. The format, width, height,
per sample, rowstride and so on, are not known in advance.
If I save my string to a file and create a pixbuf with
Gdk::Pixbuf.new(myfile), this works, but I would like to get my pixbuf
without touching the hard disk. Is that possible?
Any help appreciated.
this is how i did it:
If it’s an encoded image (e.g. JPEG, PNG etc) rather than a serialized
GdkPixdata, you’ll want to use Gdk::PixbufLoader
loader = Gdk::PixbufLoader.new
pixbuf = loader.pixbuf
2009/1/8 Dobai-Pataky B. [email protected]
Thank you to both of you for your quick reply. Yes, my string contains
dump of an encoded file. It’s not a string of pixels. The PixbufLoader
solution made the trick! I should not work when I’m too tired, this
misread the documentation
2009/1/8 Geoff Y. [email protected]