diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-08-10 16:31:23 +0200 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-08-10 16:31:23 +0200 |
| commit | e291c5c25b81c9e944523227ea55f7f96e2472ca (patch) | |
| tree | 2e6a9fd21517d961c51eba2bde1b9f89f8d57c4b /items.c | |
| parent | 7f74efd63d8026e1d11d33aa9f3b236127bb89dc (diff) | |
| download | cataract-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.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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); |
