Instalar un programa xerador de miniaturas

The GNOME file manager, Nautilus, can display little thumbnails tailored for each file instead of generic icons in its file lists. For example, a word processor document can be made to appear as a little version of the first page in the document. This is useful because users can see a small representation of the visible data in their files, which may aid in recalling what file they are looking for. You can make your application create these thumbnails with a few simple steps.

A thumbnailer is a program with no user interface that takes a file and a pixel size as inputs, and it writes a thumbnail for that file. GNOME determines which thumbnailer program to use based on the MIME type of the file for which a thumbnail is to be generated. The mapping between MIME types and thumbnailer programs is stored as a series of GConf keys.

For each MIME type which you want to handle, you have to create a pair of GConf keys:

/desktop/gnome/thumbnailers/application@x-foo/enable

Type: boolean. Determines whether this thumbnailer will be run. You can enable or disable each individual thumbnailer. When you install a new thumbnailer, you should of course make this key's value be true.

/desktop/gnome/thumbnailers/application@x-foo/command

Type: string. The command which GNOME will use when it needs to generate a thumbnail for a file of type application@x-foo. For example, the value could be "application-x-foo-thumbnailer %i %o %s". See below for an explanation of the percent signs.

That is, each MIME type requires two GConf keys (enable and command) under the same path. The path name can be derived from the MIME type name by substituting a "/" with "@". For example, a thumbnailer for image/x-my-format would need two keys: /desktop/gnome/thumbnailers/image@x-my-format/enable and /desktop/gnome/thumbnailers/image@x-my-format/command.

Dentro da chave command GNOME buscará secuencias de porcentaes e os substituirá con valores actuais:

%i Nome do ficheiro de entrada. Isto é o ficheiro que o seu xerador de miniaturas debe ler.
%u URI de entrada. SE o seu xerador de miniatura pode xestionar URI no lugar de ficheiros de nomes planos, use %u no lugar de %i.
%o Nome do ficheiro de saída. Isto é onde o seu xerador de miniaturas debe escribir a imaxe en miniatura en formato PNG.
%s Size of the thumbnail as a single integer. For example, if this gets substituted with 128, it means that your thumbnailer should output an image no bigger than 128×128 pixels.

TAnto %s como %u deben aparecer na súa liña de ordes e %o tamén é obrigatoria. A substitución %s é opcional, pero recoméndase que o seu xerador de miniaturas a teña en conta.

2.2.1. Información adicional

Como un parámetro adicional pode activar a chave booleana /desktop/gnome/thumbnailers/disable_all para deactivar a xeración tódalas miniaturas.