in reply to Re: Using Tk::TableMatrix for gallery image manipulation?
in thread Using Tk::TableMatrix for gallery image manipulation?

Didn't know that base64 encoding images speeded up image loading. It's certainly a step in the right direction. Thanks, man (zentara).

Zenatara wrote: "People have been trying to experiment with somehow "freezing" and "thawing" the actual Tk::Photo objects"

Yes, that would be the ideal solution. I assume that quite allot happens with that base64 encoded data before photo is generated, but since it's a c widget (Tk::Photo, child of Tk::Image) I didn't understand much of what is going on inside..

from image.pm
my $obj = $widget->Tk::image('create',$leaf,@_);

How/where can we decrypt (or even find) the "create" method?

  • Comment on Re^2: Using Tk::TableMatrix for gallery image manipulation?

Replies are listed 'Best First'.
Re^3: Using Tk::TableMatrix for gallery image manipulation?
by zentara (Cardinal) on Jun 16, 2006 at 12:55 UTC
    Didn't know that base64 encoding images speeded up image loading

    Well you are misinterpreting what is happening. The base64encoding only is helping in an indirect way, and really is a Tk-only thing. Tk has a particular ideosyncrancy, that it wants it's images to be base64encoded (the reason is probably buried deep down in the c code). When you load a Photo object from -file, it does the base64encoding automatically. When loading a Photo object from -data, you must provide the encoding yourself.

    So, in this particular instance, we can save the thumbnails as encoded images in one big file. That gives us 2 speed bonuses. The first is that we are saving the time it takes for Tk to base64encode the files, and the second, is that the system only has to open 1 file, the 'notebook.db', instead of 100 smaller thumbnail files. Disk I/O is the biggest slowdown in most programs.

    As far as freezing the Photo object itself, you are in virgin territory. Many attempts have been made by people smarter than me, and they have given up because of all the complexities.


    I'm not really a human, but I play one on earth. flash japh