Prototype thumbnailer now has a Epeg plugin

Philip Van Hoof spam at pvanhoof.be
Wed Oct 29 04:52:53 PDT 2008


On Mon, 2008-10-27 at 13:38 +0100, Philip Van Hoof wrote:
> Hi there,
> 
> I implemented a plugin that uses Carsten's Epeg library to create
> thumbnails of Jpeg files[3].

This EPeg support made me conclude that the specialized thumbnailers do
need a URI-scheme support registration. But not for tackling the VFS
issue.

The reason is that you can have a thumbnailer R that doesn't support
remote URI schemes, and you can have a thumbnailer K, supporting the
same MIME types as R, that does support remote URI schemes.

For example the EPeg thumbnailer doesn't support remote URIs, because
the library EPeg only works with local paths. The GdkPixbuf based
thumbnailer supports both remote and local URIs, as the GdkPixbuf based
thumbnailer uses GIO and GInputStream to load the image from.

This means that the generic thumbnailer needs to elect the GdkPixbuf
based one in case of a URI-scheme that is not file and a MIME type that
is image/jpeg.

However

In case the URI-scheme is "file" and the MIME typs is "image/jpeg", it
instead needs to elect the EPeg based thumbnailer.

At the "Registering your thumbnailer" section [1] I added support for
this use-case to the specification.

$XDG_DATA_DIRS/thumbnailers/com.rasterman.Thumbnailer.service:

[D-BUS Thumbnailer]
Name=com.rasterman.Thumbnailer
MimeTypes=image/jpeg
Comment=The great EPeg thumbnailer
UriSchemes=file

$XDG_DATA_DIRS/thumbnailers/org.gnome.Thumbnailer.service:

[D-BUS Thumbnailer]
Name=org.gnome.Thumbnailer
MimeTypes=image/jpeg;image/png;...
Comment=The also great GNOME thumbnailer, but less fast than EPeg
UriSchemes=file;sftp;ftp;http;smb;nfs;dav

To make sure that the EPeg one is elected for local files that are JPegs
you either make sure com.rasterman.Thumbnailer.service's mtime is more
recent than org.gnome.Thumbnailer.service and/or you write an overrides:

$XDG_DATA_DIRS/thumbnailers/overrides:

[file-image/jpeg]
Name=com.rasterman.Thumbnailer

ps. The prototype [2] is adapted for this.


[1] http://live.gnome.org/ThumbnailerSpec#head-2a0cd233f583dcde553c0a8b5150fa737f73cdce
[2] https://stage.maemo.org/svn/maemo/projects/haf/trunk/hildon-thumbnail/

hf

-- 
Philip Van Hoof, freelance software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://pvanhoof.be/blog
http://codeminded.be



More information about the xdg mailing list