Review of the thumbnailer spec

Jannis Pohlmann jannis at xfce.org
Thu May 14 19:00:22 PDT 2009


Hey,

this mail is intended to sum up the chat I had with Philip today and to
maybe get some feedback on my/our thoughts ... and maybe even get a
discussion started! (ZOMG!)

If anyone is not familiar with the spec, you can read it on
http://live.gnome.org/ThumbnailerSpec. It's implemented as a service
for Hildon already. I'm currently working on implementing it for
exo/Thunar.

So here's a little review to serve as a base for discussion about how
we can improve the spec (which I think is pretty neat already).

The main purpose of the org.freedestop.thumbnailer.Generic interface
is to provide methods for requesting thumbnails for files. In addition
it gives applications control over the request processing (e.g. via the
Queue and Unqueue methods).

In theory, this should completely hide how thumbnails are stored. For
instance, it doesn't really matter whether a cache is used or not. It
doesn't even matter where the thumbnails are stored.
  However, the interface has a number of methods related to modify the
thumbnail cache specified in the thumbnail managing spec [1]. These are
Move, Copy, Delete and Cleanup. Now the question is, do we want to move
these into a separate (possibly optional) interface like
o.fd.thumbnailer.CacheManager? 

There are a number of reasons why this might be reasonable. Some
implementations of the o.fd.thumbnailer.Generic interface may simply not
need it. After all it's just an implementation detail related to the
thumbnail managing spec. And then there are a lot of applications which
don't need to modify the cache at all, other than requesting new icons
(which, from the caller's POV, has nothing to do with the cache), like
simple image viewers. For other applicaitons like file managers this
interface is really useful because they usually request a lot of
thumbnails and also involve moving/copying/deleting of thumbnailed
files.

Of course this raises the question how the interfaces should be named.
Should it be org.freedesktop.thumbnailer.* or
org.freedesktop.thumbnails.*, or even a mixture of both? Should it be
org.freedesktop.thumbnailer.Cache or .CacheManager? 
  Also, the name .Generic is rather undescriptive. I'm pretty sure we
there's a better name for this. Let me throw .Provider, .Service
or .Delegate in the pot as a few of my first ideas.

I think we should improve the description of Unqueue a little bit.
Unqueue doesn't really prevent service-side implementations of unqueing
batch tasks (more than one URI queued as one handle) in the middle of
the task (e.g. after having generated thumbnails for 2 out of 10 URIs).
  This is exactly what e.g. file managers need though. Just imagine a
file manager enters a directory, queues all its files for thumbnailing
and then switches the directory before all files are processed by the
thumbnailer. So IMHO it should be pointed out more clearly that this is
not a violation of the spec. Right now it just says "You can't unqueue
requests that are currently running." This should be something like
"You cannot cancel the processing of individual URIs but thumbnailers
are free to support cancelling running tasks between the processing two
URIs when a task unqueued."

Another thing I noticed is that timestamps passed over D-Bus (e.g. the
"since" argument to org.freedesktop.thumbnailer.Generic.Cleanup) are 32
bit unsigned integers ("u") while they should really be 64 bit uints
("x"). Philip told me the reason to use "u" was that some D-Bus
versions didn't handle "x" properly. On the long run there's no way
around 64 bit ints though, I guess. 

Last but not least, the spec is not an official fd.o spec yet. Once my
implementation is ready we'll have at least two implementations used in
two different environments (Hildon and Xfce). If Thunar, the Xfce file
manager, turns out to work well with my implementation I don't see a
reason why we wouldn't want to advertise the spec a bit more - e.g. by
making it official on fd.o.

Opinions, ideas or comments in general? Fire away!

  - Jannis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/xdg/attachments/20090515/6b31d070/attachment.pgp 


More information about the xdg mailing list