diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-07-31 00:16:12 +0200 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-07-31 00:16:12 +0200 |
| commit | 64c8713ab4a64eaf53a764530837bd3ae47a89d2 (patch) | |
| tree | cf491779baf6f20190fd80c6d04633df5dea776d /items.c | |
| parent | 85cdaaaeafd9eb4ff5e6f6db87e1df5e2e41b431 (diff) | |
| download | cataract-64c8713ab4a64eaf53a764530837bd3ae47a89d2.tar.xz | |
The <item src> parameter can now be omitted when preview src is specified
Skip items with no source or preview image src specified.
Diffstat (limited to 'items.c')
| -rw-r--r-- | items.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -113,20 +113,28 @@ parse_album_xml (const char *filename, TAlbum *index) g_free (s); s = g_strdup_printf ("/gallery/items/item[%d]/nofullsize", i + 1); - item->nofullsize = xml_file_get_node_present (xml, s); + item->nofullsize = (xml_file_get_node_present (xml, s) || item->path == NULL); g_free (s); - g_ptr_array_add (index->items, item); + if (item->path || item->preview) + { + g_ptr_array_add (index->items, item); + } + else + { + fprintf (stderr, "%s: No image src specified, skipping!\n", filename); + free (item); + } } xml_parser_close (xml); /* Print the items */ #ifdef __DEBUG_ALL__ - printf("ID = '%s'\ntitle = '%s'\ndescription = '%s'\n", index->ID, index->title, index->desc); + printf ("ID = '%s'\ntitle = '%s'\ndescription = '%s'\n", index->ID, index->title, index->desc); for (i = 0; i < index->items->len; i++) { - TIndexItem *item = g_ptr_array_index(index->items, i); - printf("item %d: path = '%s', title = '%s', title_description = '%s', thumbnail = '%s'\n", + TIndexItem *item = g_ptr_array_index (index->items, i); + printf ("item %d: path = '%s', title = '%s', title_description = '%s', thumbnail = '%s'\n", i, item->path, item->title, item->title_description, item->thumbnail); } #endif |
