Specifying thumbnailers as a service

Philip Van Hoof spam at pvanhoof.be
Mon Sep 1 05:23:08 PDT 2008


On Mon, 2008-09-01 at 13:59 +0200, Lubos Lunak wrote:

> > I think canceling is overkill. Making a thumbnail doesn't take longer
> > than a minute (and a minute is an extreme case). Users don't cancel
> > that.

>  It wasn't meant for a user. If the user scrolls the view, then the visible 
> files should get thumbnails first. The simplest idea seemed to be cancelling 
> and starting anew. (This was meant under the assumption that it would be for 
> real-time generation of thumbnails, which appears to be false.)

If your thumbnailer is asynchronous it could also prioritize requests in
a LIFO queue.

I think the recommendation should indeed be to make the thumbnailer
handler handle requests asynchronously and we could recommend LIFO for
this.

Would that solve the use-case you have in mind for canceling? I really
think having a reliable cancel is a bit overkill, quite hard to both
specify and implement too.

For example, how soon must a cancel take place? Relatively few thumbnail
algorithms have reliable cancel points embedded (if any). A function
like pthread_cancel() shouldn't be used here, as that will inevitably
lead to leaking and unportable code.

So if we drag cancellations into the specification, we make it more or
less impossible for an implementer to fulfill the entire specification
correctly.

Usually (always) impossible-to-implement specifications are bad ones.

> > > - thumbnail generators usually don't go via saving to disk but use some
> > > more efficient way (e.g. pass data in-process)
> >
> > Passing pixbuf data over IPC doesn't sound very efficient to me. I also
> > wonder why you would do that over IPC?!
> >
> > Just make a library that does it for your application (like your
> > `create_image` below).
> 
>  I'll take this as "no" to my original question about whether your proposal is 
> also meant for apps like file managers (i.e. real-time generation). In that 
> case, however, I suggest you use a better fitting name. A thumbnailer I would 
> say is something that creates a thumbnail (that is, a picture) out of a file. 
> What you are suggesting is thumbnail management.

A better name is indeed thumbnail management.

> > You can of course still make a library that just creates the thumbnail.
> 
>  So, again, this is not about thumbnailers, this is about thumbnail management 
> then. It was not clear to me from your original mail.

Ok

We can of course mention this name in the request-bug (a specification
for thumbnail management) (done).

https://bugs.freedesktop.org/show_bug.cgi?id=17376



-- 
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