Le dimanche 10 septembre 2006 à 17:16 +0100, Jamie McCracken a écrit :
> Laurent Aguerreche wrote:
> > Hello,
> >
> > currently trackerd generates thumbnails for PDF files. I just wonder
> > whether it is useful!
> >
> > To have this feature, trackerd calls evince (which depends on many
> > components of X and GNOME...) and those calls slowdown a little bit
> > trackerd.
> >
> > Graphical shells, like Nautilus, Konqueror or Thunar, are supposed to
> > know how to make thumbnails from files, and I have already many
> > generated thumbnails in ~/.thumbnails. So I think that trackerd should
> > not do thumbnails and let other programs do it by themselves.
> >
> > Am I missing something?
> >
> >
>
> Yes.
>
> Doing it in tracker means you wont have to wait for file managers to
> thumbnail.
Yes but I don't care about that! IMHO trackerd should be dedicated to
extract datas from documents for research, and only for research.
In future if trackerd does a thumbnail for each indexed file it will
spend something like an equal, or greater, time for this task than for
extracting datas.
Furthermore I know that I have some documents that I won't never open
because they are in archives, in big projects, etc. So while trackerd is
losing its time with thumbnailing for documents that I won't never open,
live queries aren't as responsives as they could be for instance.
> However:
>
> 1) thumbnails should be optional so feel free to add an option to
> disable them.
Ok. So I propose a patch.
(default is DoThumbnails=true...)
> 2) They dont use the freedesktop spec for thumbnails yet. This is a bug
> and a fix would be nice
> http://lists.freedesktop.org/archives/xdg/2004-October/005067.html
But a fix doesn't seem to be so easy!
Names in ~/.thumbnails/{normal,large,fail} are md5 hashes. I think it
isn't a problem since there is a free (in public domain) implementation
available in libgnomeui (it just takes time to compute uri). But
problems come right after: thumbnails need to be resized and tagged. In
libgnomeui, GDK is used. Since GDK is dependent to X, a replacement
should be found...
> 3) long term plan is to add *optional* gconf facility for replacing the
> config file and getting access to all the the thumbnailers defined in
> gconf (see keys /desktop/gnome/thumbnailers in gconf-editor)
Hum... and a corresponding thing for KDE's users? ;-)
It could be interesting to have a way to change options dynamically.
With DBus?
Laurent.
diff -x CVS -pruN tracker.orig/src/trackerd/trackerd.c tracker.modif/src/trackerd/trackerd.c
--- tracker.orig/src/trackerd/trackerd.c 2006-09-07 13:06:15.000000000 +0200
+++ tracker.modif/src/trackerd/trackerd.c 2006-09-11 00:43:35.000000000 +0200
@@ -921,7 +921,7 @@ extract_metadata_thread (void)
if (info) {
if (info->uri) {
GHashTable *meta_table;
- char *small_thumb_file, *file_as_text;
+ char *file_as_text;
tracker_log ("Extracting Metadata for file %s with mime %s", info->uri, info->mime);
@@ -944,25 +944,29 @@ extract_metadata_thread (void)
g_hash_table_destroy (meta_table);
- /* see if there is a thumbnailer script for the file's mime type */
+ if (tracker->do_thumbnails) {
+ char *small_thumb_file;
- small_thumb_file = tracker_metadata_get_thumbnail (info->uri, info->mime, THUMB_SMALL);
+ /* see if there is a thumbnailer script for the file's mime type */
- if (small_thumb_file) {
- char *large_thumb_file;
+ small_thumb_file = tracker_metadata_get_thumbnail (info->uri, info->mime, THUMB_SMALL);
- large_thumb_file = tracker_metadata_get_thumbnail (info->uri, info->mime, THUMB_LARGE);
+ if (small_thumb_file) {
+ char *large_thumb_file;
- if (large_thumb_file) {
+ large_thumb_file = tracker_metadata_get_thumbnail (info->uri, info->mime, THUMB_LARGE);
- tracker_db_save_thumbs (db_con, small_thumb_file, large_thumb_file, info->file_id);
+ if (large_thumb_file) {
- /* to do - emit dbus signal ThumbNailChanged */
+ tracker_db_save_thumbs (db_con, small_thumb_file, large_thumb_file, info->file_id);
- g_free (large_thumb_file);
- }
+ /* to do - emit dbus signal ThumbNailChanged */
+
+ g_free (large_thumb_file);
+ }
- g_free (small_thumb_file);
+ g_free (small_thumb_file);
+ }
}
file_as_text = tracker_metadata_get_text_file (info->uri, info->mime);
diff -x CVS -pruN tracker.orig/src/trackerd/tracker-utils.c tracker.modif/src/trackerd/tracker-utils.c
--- tracker.orig/src/trackerd/tracker-utils.c 2006-09-10 02:04:07.000000000 +0200
+++ tracker.modif/src/trackerd/tracker-utils.c 2006-09-11 00:30:04.000000000 +0200
@@ -1476,7 +1476,10 @@ tracker_load_config_file ()
"IndexFirefoxHistory=true\n\n",
"[Database]\n",
"StoreTextFileContentsInDB=false\n",
- "DBBufferMemoryLimit=1M\n", NULL);
+ "DBBufferMemoryLimit=1M\n",
+ "[Thumbnails]\n"
+ "DoThumbnails=true\n",
+ NULL);
g_file_set_contents (filename, contents, strlen (contents), NULL);
g_free (contents);
@@ -1563,8 +1566,15 @@ tracker_load_config_file ()
if (g_key_file_has_key (key_file, "Database", "StoreTextFileContentsInDB", NULL)) {
store_text_file_contents_in_db = g_key_file_get_boolean (key_file, "Indexes", "StoreTextFileContentsInDB", NULL);
}
+
+ db_buffer_memory_limit = g_key_file_get_string (key_file, "Database", "DBBufferMemoryLimit", NULL);
*/
- //db_buffer_memory_limit = g_key_file_get_string ( key_file, "Database", "DBBufferMemoryLimit", NULL);
+
+ if (g_key_file_has_key (key_file, "Thumbnails", "DoThumbnails", NULL)) {
+ tracker->do_thumbnails = g_key_file_get_boolean (key_file, "Thumbnails", "DoThumbnails", NULL);
+ } else {
+ tracker->do_thumbnails = TRUE;
+ }
g_free (filename);
diff -x CVS -pruN tracker.orig/src/trackerd/tracker-utils.h tracker.modif/src/trackerd/tracker-utils.h
--- tracker.orig/src/trackerd/tracker-utils.h 2006-09-07 13:06:15.000000000 +0200
+++ tracker.modif/src/trackerd/tracker-utils.h 2006-09-11 00:30:02.000000000 +0200
@@ -48,6 +48,8 @@ typedef struct {
GSList *poll_list;
gboolean use_nfs_safe_locking;
+ gboolean do_thumbnails;
+
GHashTable *file_scheduler;
GMutex *scheduler_mutex;
_______________________________________________
tracker-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/tracker-list