summaryrefslogtreecommitdiff
path: root/items.c
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2008-08-10 16:31:23 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2008-08-10 16:31:23 +0200
commite291c5c25b81c9e944523227ea55f7f96e2472ca (patch)
tree2e6a9fd21517d961c51eba2bde1b9f89f8d57c4b /items.c
parent7f74efd63d8026e1d11d33aa9f3b236127bb89dc (diff)
downloadcataract-e291c5c25b81c9e944523227ea55f7f96e2472ca.tar.xz
Support for supplied thumbnails
(useful if you have framed preview and original images and want to have non-framed thumbnails)
Diffstat (limited to 'items.c')
-rw-r--r--items.c10
1 files changed, 7 insertions, 3 deletions
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);