Re: Pixbuf loading question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



El lun, 07-04-2008 a las 15:23 +0200, nico escribió:> > For creation of thumbnails on an image list ( inside a gtk.Treeview),> I> create a pixbuf for each thumbnail.> > After power up of my laptop  , I load the program and my 500 images (> image loading is made on  background) ,  for the creation of pixbuf, I> can see many disc access to load the pixbuf ( I use the command> pixbuf_new_from_file ).
If your application targets GNOME or other freedesktop compliantenvironment, you are using a wrong approach. Instead, you should loadthe thumbnails from the thumbnails cache. That way you avoid loadingimages that could take long to load and resize, and instead load alreadyscaled pixbufs.
Check the GnomeThumbnail section in libgnomeui.
> > Then if I quit the application, and reload the program, The load time> is> very short, and I can no more notice disc access. It's like my pixbufs> stays in memory, and gtk application did not need to reload from file.> It's very useful for loading time but I don't understand why  and how> the buffers  "stays in memory"
That's something that the OS does for you.> > How it is possible to force my application to start with the same> behavior as the first launch ( many disc accces), without rebooting my> laptop each time (;-() . I need that to optimize the  loading of the> pixbuf on background.
At least in Linux, I vaguely remember that there's a way to tell thekernel to empty the cache. If you use Linux, you could ask in a morekernel oriented mailing list.

Now, going to the specific problem you have: you could try doing aon-demand load of the thumbnails, like we do in the thumbpane in eog.That is, instead of loading all the thumbnails in the treeview, loadonly the thumbnails for the items currently visible. If you are worriedas well about memory usage, you may optionally unload those that gethidden on scrolling. Otherwise, keeping them loaded would do fine.
Claudio
-- Claudio Saavedra <csaavedra@xxxxxxxxxxxxxxxxx>
_______________________________________________gtk-list mailing listgtk-list@xxxxxxxxxxxxx://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux