renegadex has asked for the wisdom of the Perl Monks concerning the following question:
Hi!
i have this code:
i want to put the picture loaded by imagemagick into memory, then the memory is read by a gdk pixbuf. also, if my picture is big (2000x2000 pixels) i think it would be very slow to convert it into xpm format... any other ideas to get image data from image magick using gdk pixbuf without writing to disk. tnx!use Gtk2 '-init'; use Image::Magick; my $magick = Image::Magick->new; $magick->Read('pictures/ian.jpg'); $magick->Set(magick=>'xpm'); my $blob = $magick->ImageToBlob(); $pixbuf = Gtk2::Gdk::Pixbuf->new_from_xpm_data ($blob); i get this error: GdkPixbuf-WARNING **: Inline XPM data is broken: Invalid XPM header at + tk-photo.pl line 9.
Back to
Seekers of Perl Wisdom