From e291c5c25b81c9e944523227ea55f7f96e2472ca Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 10 Aug 2008 16:31:23 +0200 Subject: Support for supplied thumbnails (useful if you have framed preview and original images and want to have non-framed thumbnails) --- items.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'items.c') diff --git a/items.c b/items.c index 91eee63..77f051f 100644 --- a/items.c +++ b/items.c @@ -101,6 +101,8 @@ parse_album_xml (const char *filename, TAlbum *index) item->width = xml_file_get_node_attribute_long (xml, s, "width", 0); item->height = xml_file_get_node_attribute_long (xml, s, "height", 0); item->border_style = xml_file_get_node_attribute (xml, s, "border"); + if (index->type == GALLERY_TYPE_ALBUM) + item->thumbnail = xml_file_get_node_attribute (xml, s, "thumbnail"); g_free (s); s = g_strdup_printf ("/gallery/items/item[%d]/title/text()", i + 1); @@ -111,9 +113,11 @@ parse_album_xml (const char *filename, TAlbum *index) item->title_description = xml_file_get_node_value (xml, s); g_free (s); - s = g_strdup_printf ("/gallery/items/item[%d]/thumbnail", i + 1); - item->thumbnail = xml_file_get_node_attribute (xml, s, "src"); - g_free (s); + if (index->type == GALLERY_TYPE_INDEX) { + s = g_strdup_printf ("/gallery/items/item[%d]/thumbnail", i + 1); + item->thumbnail = xml_file_get_node_attribute (xml, s, "src"); + g_free (s); + } s = g_strdup_printf ("/gallery/items/item[%d]/nofullsize", i + 1); item->nofullsize = (xml_file_get_node_present (xml, s) || item->path == NULL); -- cgit v1.2.3