A Standard for Thumbnailers

Benedikt Meurer benny at xfce.org
Thu Jan 11 03:39:55 PST 2007


Stanislav Brabec wrote:
>>> For typical small and simple thumbnailer it saves only few milliseconds
>>> per image, for thumbnailers preloading larger libraries it may be more.
>> There are very good reasons to avoid this. You don't want to load
>> arbitrary code into the file manager (or any other process) just to
>> create a thumbnail. See Alex' for good reasons to avoid this.
>>
>> From the performance POV, we're talking about milliseconds, because it
>> doesn't really matter whether ld loads the shared libraries into our
>> process or into a new process. It's basicly the fork overhead, plus some
>> additional setting up (but since thumbnailers, except for the very basic
>> ones, will usually not benefit from previously performed file manager
>> initialization, except probably g_type_init() to use GdkPixbuf, this
>> doesn't take much time).
> 
> For one single image we're talking about milliseconds. For large
> directory with thousands of images, you can save more, because you can
> save repeated loading of shared libraries.

You don't look at thousands of images at once. A smart implementation
will thumbnail only on-demand, so we're talking about up to 50
thumbnails at once. So it's a max of 50 times a few milliseconds.

> I was thinking about thumbnailer modules implemented in the exactly
> equal way as GdkPixbuf loaders.
> But yes, such thumbnailers must not crash. You can always write a
> wrapper to use executable thumbnailer.

...and they must be thread-safe, and they must be cleanly unloadable,
and so on.

There may be a few that can really benefit here (i.e. the already
mentioned JPEG thumbnailer). Such thumbnailers can be build into the
file manager or loaded from a module, because they are trivial. But for
the vast majority of thumbnailers (i.e. HTML, PDF, PostScript, LaTeX,
Office Documents, etc.) those milliseconds don't mean anything, and
loading the thumbnailer into the file manager is likely to cause trouble
(i.e. I really don't want to load a TeX interpreter and various LaTeX
packages into the file manager just to generate a thumbnail).

Benedikt



More information about the xdg mailing list