Am 27.05.2011 10:09, schrieb Richard Shann:
> On Thu, 2011-05-26 at 23:01 +0200, Till Hartmann wrote:
>> I think what you have to do is to append "::Thumb::URI" to "tEXt" and
>> remove that piece from your current uri string:
>> gdk_pixbuf_save (pb, thumbpath, "png"/*type*/, &err,
>> "tEXt::Thumb::URI",
>> uri [...])
> That appears to work, thank you. I say appears as the warning message is
> gone, but I am not sure we have anything to retrieve the information
> currently...
> Richard
>
>
I checked the sourcecode, here's what needs to be changed to make it work ;)
- you need to create an md5sum of the file's URI - and that includes the
leading "file://" (be aware that due to the fact that unix paths start
with a leading slash, it will be "file:///home[...]". If you're planning
to use the thumbnails in the open-dialog, be sure to make that filename
to uri process windows safe)
- at least nautilus uses the normal-sized thumbnails as default, be sure
to store both sizes (you can never be sure which applications make use
of which thumbsize ;) )
diff --git a/src/print.c b/src/print.c
index d268fb5..929d34c 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1227,16 +1227,17 @@ void thumb_finished(GPid pid, gint status, GList
*filelist) {
}
gchar *printname = get_thumb_printname();
gchar *printpng = g_strconcat(printname, ".png", NULL);
- GdkPixbuf *pb = gdk_pixbuf_new_from_file_at_scale (printpng, 256, -1,
TRUE, &err);
+ GdkPixbuf *pb = gdk_pixbuf_new_from_file_at_scale (printpng, 128, -1,
TRUE, &err);
//FIXME if pb->height>256 scale it down...
if(pb) {
- gchar *basethumbname = g_compute_checksum_for_string
(G_CHECKSUM_MD5, Denemo.gui->filename->str, -1);
- gchar *thumbname = g_strconcat(basethumbname, ".png", NULL);
- g_free(basethumbname);
- gchar *uri = g_strdup_printf("file:///%s", thumbname);
+ gchar *uri = g_strdup_printf("file://%s",
Denemo.gui->filename->str);
+ gchar *hash = g_compute_checksum_for_string (G_CHECKSUM_MD5, uri,
-1);
+ gchar *thumbname = g_strconcat(hash, ".png", NULL);
+ g_free(hash);
+ g_printf("%s -> %s\n", uri, thumbname);
static gchar *thumbnailsdir = NULL;
if(!thumbnailsdir) {
- thumbnailsdir = g_build_filename (g_get_home_dir(),
".thumbnails", "large", NULL);
+ thumbnailsdir = g_build_filename (g_get_home_dir(),
".thumbnails", "normal", NULL);
g_mkdir_with_parents(thumbnailsdir, 0700);
}
_______________________________________________
Denemo-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/denemo-devel