From 0f3fcf7c383271a3762b52e38309bc18fca49aec Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sat, 7 Mar 2009 21:46:27 +0100 Subject: Favicon support --- src/generators.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/generators.c') diff --git a/src/generators.c b/src/generators.c index e07a880..992370a 100644 --- a/src/generators.c +++ b/src/generators.c @@ -356,6 +356,14 @@ write_html_album (TGallerySetup *setup, g_free (s1); s1 = s2; } + if (setup->favicon_file && strlen (setup->favicon_file) > 0) { + if (setup->favicon_type) + s2 = g_strdup_printf ("%s\t\n", s1, setup->favicon_type, setup->favicon_file); + else + s2 = g_strdup_printf ("%s\t\n", s1, setup->favicon_file); + g_free (s1); + s1 = s2; + } replace_table_add_key (global_replace_table, "CGG_META_TAGS", s1); g_free (s1); @@ -805,6 +813,14 @@ write_html_image (TGallerySetup *setup, g_free (s1); s1 = s2; } + if (setup->favicon_file && strlen (setup->favicon_file) > 0) { + if (setup->favicon_type) + s2 = g_strdup_printf ("%s\t\n", s1, setup->favicon_type, setup->favicon_file); + else + s2 = g_strdup_printf ("%s\t\n", s1, setup->favicon_file); + g_free (s1); + s1 = s2; + } replace_table_add_key (replace_table, "CGG_META_TAGS", s1); g_free (s1); @@ -950,6 +966,18 @@ build_tree (TGallerySetup *setup, g_free (s2); if (setup->verbose) printf (" done.\n"); + if (setup->favicon_file && strlen (setup->favicon_file) > 0) { + if (setup->verbose) printf ("Writing '%s' ...", setup->favicon_file); + s3 = g_path_get_dirname (setup->setup_xml_path); + s1 = g_strconcat (s3, "/", setup->favicon_file, NULL); + s2 = g_strconcat (dst_dir, "/", setup->favicon_file, NULL); + copy_file (s1, s2); + g_free (s1); + g_free (s2); + g_free (s3); + if (setup->verbose) printf (" done.\n"); + } + /* Prepare target thumbnail directory */ thumb_dir = g_strconcat (dst_dir, "/", THUMBNAIL_DIR, NULL); -- cgit v1.2.3