Re: [Tracker] fd.o compliant thumbnailing



Ok.  Here's a patch to tracker-thumbnailer to
 1) Remove the old style /path/to/mime/type_thumbnailer
 2) Support the Thundar style .desktop file
 3) If ^^^^^ fails, try gconf's
/desktop/gnome/thumbnailers/mime type/command key
 4) Add .desktop thumbnailers for OO.o, Dia, pdf, and ps (all depend
on imagemagick)

The thumbnails that get generated are not immediately found by
nautilus (killall nautilus fixes that), however Thundar appears to be
tracking ~/.thumbnails, so the thumbnails generated by tracker show
up.

On 1/8/07, Jamie McCracken <jamiemcc blueyonder co uk> wrote:
Erlend Davidson wrote:
>
> Jamie McCracken wrote:
>> Erlend Davidson wrote:
>>> Jamie McCracken wrote:
>>>> Erlend Davidson wrote:
>>>>
>>>>> That would require a whole standard for thumbnailers... the thunar
>>>>> ones take three or four command-line arguments (input file, size,
>>>>> output file and optionally the URI of the file), this should be
>>>>> sufficient, but someone might want more and then the standard would
>>>>> break.
>>>> not really the same arguments are used by gnome in its gconf based
>>>> thumbnailers so its already a de facto standard. (A;though I dont
>>>> know what KDE uses?)
>>> KDE is slightly different I think.  For example with kwebdesktop
>>> (which is used to thumbnail webpages),
>>>
>>> kwebdesktop 640 480 output_file input_file.
>>>
>>>
>>> This is not an impossible problem to overcome however, as the thunar
>>> way of calling external thumbnailers involves the use of a .desktop
>>> file, like:
>>>
>>> ---< html-thumbnailer.desktop >---
>>> [Desktop Entry]
>>> Version=1.0
>>> Encoding=UTF-8
>>> Type=X-Thumbnailer
>>> TryExec=kwebdesktop
>>> MimeType=text/html;
>>> Name=HTML Thumbnailer
>>> X-Thumbnailer-Exec=kwebdesktop 640 480 %o %u
>>>
>>>
>>> which can be used to change the order of arguments.
>>>>> Incidently tracker uses the same command-line arguments as thunar
>>>>> for thumbnailers.  Coud you possibly change tracker to use the same
>>>>> directory as thunar?
>>>> thats my point - the only thing not standardised is the location of
>>>> the scripts and thats why a freedesktop specified location would be
>>>> preferred by tracker.
>>> I might e-mail the xdg list.
>>>> In the short term, I can of course check for gnome thumbs using
>>>> GConfTool (which does not require linking in GConf) and as you say
>>>> the thunar directory if it exists so patches welcome for that.
>>>>
>>>> feel free to add a bugzilla enhancement request
>>>> (http://bugzilla.gnome.org) to tracker and I will get round to it
>>>> eventually if no patch is forthcoming
>>> What area of the source should I look in to?
>> src/trackerd/tracker-metadata.c
>>
>> function tracker_metadata_get_thumbnail
> Actually it's src/tracker-thumbnailer/tracker-thumbnailer.c
> just after the comment:
> /* do we have a thumbnailer for this mime type? */
>
> Is there an easy way to process .desktop files?  What needs to be done
> is all .desktop files in /usr/local/share/thumbnailers/ read and only
> those with "MimeType=argv[2]" selected.  Then read
> TryExec=DEPEND_ON_THIS_BINARY and check that DEPEND_ON_THIS_BINARY is
> executable and on the path, if so run the command specified by the key
> X-Thumbnailer-Exec.
> e.g.  convert "ps:$ifile[0]" -scale "$sizex$size" "png:$ofile"

desktop files are kinda supported using GKeyFile in glib
see
http://developer.gnome.org/doc/API/2.0/glib/glib-Key-value-file-parser.html

--
Mr Jamie McCracken
http://jamiemcc.livejournal.com/

_______________________________________________
tracker-list mailing list
tracker-list gnome org
http://mail.gnome.org/mailman/listinfo/tracker-list

Attachment: tracker-thumbnailer-v2.patch
Description: Text Data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]