Re: Loading a EXIF thumbnail with Gtk2::Gdk::Pixbuf->new_from_data
- From: Johnny Morano <jmorano moretrix com>
- To: gtk-perl-list gnome org
- Subject: Re: Loading a EXIF thumbnail with Gtk2::Gdk::Pixbuf->new_from_data
- Date: Tue, 13 Sep 2005 15:18:11 +0200
Hi,
Welcome. We'll try to make the hazing light.
Yeah, don't we just all love the haze... ;-)
According to http://park2.wakwak.com/~tsuruzoh/Computer/Digicams/exif-
e.html#ExifThumbs the thumbnail will be JPEG or TIFF, not raw bits.
oops..
Do this, instead:
my $loader = Gtk2::Gdk::PixbufLoader->new;
$loader->write ($data);
$loader->close ();
my $pixbuf = $loader->get_pixbuf ();
(That code is from memory, check for yourself to make sure i'm not
telling lies.)
i'd say: memory++ ! the above code works like a charm! man, the thumbs
are loaded fast now :-/ supah!
There's new_from_file_at_size(), which uses a PixbufLoader to scale
the image as it reads each chunk. But, this is still slower than
using the precomputed thumbnail.
jep... i already discovered that one :-)
That's referring to how to create image data in your script. The
image data is expected to be a flat buffer of pixel data, and to
manipulate the contents of such a thing in perl, you need to use pack
(). If you have packed data returned from some other source, you
have no further work to do.
ah... thought so, but, I've just started playing with gtk2-perl last
week ;-)
yeah, my exiftool is starting to work nicely (and fast!) ;-)
Cheers and thanks a heap!
J
--
Johnny Morano | insaniac moretrix com | +32.473 894685
[ perl rookie ] | [ linux geek ] | [ web kid ] | [ all ]
'%*;s{}{ohn};s.$.n.;;%@;s|(.*?)$|$1y|;s%^%j%;%;;print;*%'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]