diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-02-14 21:21:49 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-02-14 21:21:49 +0100 |
| commit | 4dc6bd21043a4ce31638e239b7c8b7a2e626e6e6 (patch) | |
| tree | 27947c8f4412659f48d0e4f0892536af56dd1d8c | |
| parent | c0d9426f47bba44a75a46bf6cf3194e613d92aeb (diff) | |
| download | cataract-4dc6bd21043a4ce31638e239b7c8b7a2e626e6e6.tar.xz | |
Support for global <nofullsize> tag
| -rw-r--r-- | generators.c | 6 | ||||
| -rw-r--r-- | items.c | 8 | ||||
| -rw-r--r-- | items.h | 4 |
3 files changed, 13 insertions, 5 deletions
diff --git a/generators.c b/generators.c index 170c283..2c7b7a0 100644 --- a/generators.c +++ b/generators.c @@ -166,7 +166,7 @@ generate_image (TGallerySetup *setup, modify_exif (big_dst, setup->erase_exif_thumbnail, setup->add_copyright); g_free (big_dst); - if (! item->nofullsize) + if (item->force_fullsize || (! item->force_nofullsize && ! items->nofullsize)) { s1 = g_path_get_dirname(dst); orig_dst = g_strconcat (s1, "/", IMG_ORIG_DIR, "/", *img_src, NULL); @@ -685,7 +685,7 @@ write_html_image (TGallerySetup *setup, /* Retrieve image sizes of preview and original image */ get_image_sizes (big_dst, &img_big_w, &img_big_h); - if (! item->nofullsize) + if (item->force_fullsize || (! item->force_nofullsize && ! parent_items->nofullsize)) get_image_sizes (orig_dst, &img_orig_w, &img_orig_h); @@ -706,7 +706,7 @@ write_html_image (TGallerySetup *setup, if (strstr (buffer, "<!-- $(END_IMG_FULLSIZE_LINK) -->")) { in_img_fullsize_link = FALSE; free (b); - if (! item->nofullsize) + if (item->force_fullsize || (! item->force_nofullsize && ! parent_items->nofullsize)) b = strdup (buf_img_fullsize_link); else continue; } @@ -87,6 +87,8 @@ parse_album_xml (const char *filename, TAlbum *index) index->meta_description = xml_file_get_node_value (xml, "/gallery/general/meta/description/text()"); index->meta_keywords = xml_file_get_node_value (xml, "/gallery/general/meta/keywords/text()"); + index->nofullsize = xml_file_get_node_present (xml, "/gallery/general/nofullsize"); + /* Section Items */ count = xml_file_node_get_children_count (xml, "/gallery/items/*"); #ifdef __DEBUG_ALL__ @@ -136,7 +138,11 @@ parse_album_xml (const char *filename, TAlbum *index) } s = g_strdup_printf ("/gallery/items/*[%d]/nofullsize", i + 1); - item->nofullsize = (xml_file_get_node_present (xml, s) || item->path == NULL); + item->force_nofullsize = (xml_file_get_node_present (xml, s) || item->path == NULL); + g_free (s); + + s = g_strdup_printf ("/gallery/items/*[%d]/fullsize", i + 1); + item->force_fullsize = (xml_file_get_node_present (xml, s) || item->path == NULL); g_free (s); s = g_strdup_printf ("/gallery/items/*[%d]/hidden", i + 1); @@ -51,6 +51,7 @@ typedef struct { char *meta_author; char *meta_description; char *meta_keywords; + gboolean nofullsize; } TAlbum; typedef struct { @@ -62,7 +63,8 @@ typedef struct { int quality; unsigned long width; unsigned long height; - gboolean nofullsize; + gboolean force_nofullsize; + gboolean force_fullsize; char *border_style; TIndexItemType type; gboolean hidden; |
