Re: Speeding up thumbnail generation (like multi threaded). Thoughts please.



On Wed, 2009-09-30 at 17:51 +0100, Ross Burton wrote:
> On Wed, 2009-09-30 at 12:32 -0400, David Zeuthen wrote:
> > (Btw, this infrastructure is not specific to the gphoto2:// GVfs
> > backend; any GVfs backend can use it - say, a Flickr backend).
> 
> Bad example, downloading the original file (no seeking in HTTP) just to
> extract the thumbnail would be pretty silly considering that Flickr
> allows direct access to thumbnails (and other sizes) through its API. :)

No, it's actually a great example.

The way it works is that a GVfs backend can set the preview::icon file
attribute (which is a GIcon) [1] to whatever it wants. In GVfs we have a
class, GVfsIcon, that implements GLoadableIcon and GIcon. When clients
read preview::icon, then the loading of the returned icon is directed
back to the backend via the open_icon_for_read() VFunc on the
GVfsBackend class. The backend can then use any API it wants to
get/create the thumbnail. It is completely unrelated to the file in
question.

     David


[1] : http://library.gnome.org/devel/gio/unstable/GFileInfo.html#G-FILE-ATTRIBUTE-PREVIEW-ICON--CAPS





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