diff options
| -rw-r--r-- | generators.c | 10 | ||||
| -rw-r--r-- | items.c | 3 | ||||
| -rw-r--r-- | items.h | 1 | ||||
| -rw-r--r-- | sample/src/setup.xml | 6 | ||||
| -rw-r--r-- | sample/src/subdir/CIAF_2/index.xml | 7 | ||||
| -rw-r--r-- | setup.c | 2 | ||||
| -rw-r--r-- | setup.h | 1 |
7 files changed, 20 insertions, 10 deletions
diff --git a/generators.c b/generators.c index c6df9c0..356c434 100644 --- a/generators.c +++ b/generators.c @@ -166,7 +166,8 @@ generate_image (TGallerySetup *setup, modify_exif (big_dst, setup->erase_exif_thumbnail, setup->add_copyright); g_free (big_dst); - if (item->force_fullsize || (! item->force_nofullsize && ! items->nofullsize)) + if (item->force_fullsize || (items->fullsize && ! item->force_nofullsize) || + (! item->force_nofullsize && ! items->nofullsize && ! setup->nofullsize)) { s1 = g_path_get_dirname(dst); orig_dst = g_strconcat (s1, "/", IMG_ORIG_DIR, "/", *img_src, NULL); @@ -623,6 +624,7 @@ write_html_image (TGallerySetup *setup, gboolean res; int level, old_parent_item_index; gboolean override_title_meta; + gboolean image_fullsize; fin = fopen (template_src, "r"); @@ -688,7 +690,9 @@ 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->force_fullsize || (! item->force_nofullsize && ! parent_items->nofullsize)) + image_fullsize = item->force_fullsize || (parent_items->fullsize && ! item->force_nofullsize) || + (! item->force_nofullsize && ! parent_items->nofullsize && ! setup->nofullsize); + if (image_fullsize) get_image_sizes (orig_dst, &img_orig_w, &img_orig_h); @@ -709,7 +713,7 @@ write_html_image (TGallerySetup *setup, if (strstr (buffer, "<!-- $(END_IMG_FULLSIZE_LINK) -->")) { in_img_fullsize_link = FALSE; free (b); - if (item->force_fullsize || (! item->force_nofullsize && ! parent_items->nofullsize)) + if (image_fullsize) b = strdup (buf_img_fullsize_link); else continue; } @@ -88,6 +88,7 @@ parse_album_xml (const char *filename, TAlbum *index) 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"); + index->fullsize = xml_file_get_node_present (xml, "/gallery/general/fullsize"); /* Section Items */ count = xml_file_node_get_children_count (xml, "/gallery/items/*"); @@ -142,7 +143,7 @@ parse_album_xml (const char *filename, TAlbum *index) 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); + item->force_fullsize = xml_file_get_node_present (xml, s); g_free (s); s = g_strdup_printf ("/gallery/items/*[%d]/hidden", i + 1); @@ -52,6 +52,7 @@ typedef struct { char *meta_description; char *meta_keywords; gboolean nofullsize; + gboolean fullsize; } TAlbum; typedef struct { diff --git a/sample/src/setup.xml b/sample/src/setup.xml index 7b8c6b0..84cc639 100644 --- a/sample/src/setup.xml +++ b/sample/src/setup.xml @@ -39,6 +39,12 @@ <!-- erase embedded thumbnail image (both from original and big images)? --> <!-- (allowed values: "yes", "no") default = no --> <erase_embed_thumbnail value="yes" /> + + <!-- don't copy full size (original) images --> + <!-- <nofullsize/> can be used globally for whole gallery, --> + <!-- for full album or selectively for each image --> + <!-- - override with <fullsize/> for album or for separate image --> +<!-- <nofullsize /> --> </images> <meta> diff --git a/sample/src/subdir/CIAF_2/index.xml b/sample/src/subdir/CIAF_2/index.xml index c5e25ca..988ef97 100644 --- a/sample/src/subdir/CIAF_2/index.xml +++ b/sample/src/subdir/CIAF_2/index.xml @@ -7,41 +7,36 @@ mezinárodní letiště Brno - Tuřany<br/> <a href="http://www.airshow.cz/18-CZ-CIAF-07-Home.html">http://www.airshow.cz/18-CZ-CIAF-07-Home.html</a><br/> ]]></description> + <nofullsize /> </general> <items> <item src="img_6803.jpg"> - <nofullsize /> <title>L-159 ALCA</title> <title_description><![CDATA[<a href="http://www.airshow.cz/115-CZ-Letecka-technika-L159.html">http://www.airshow.cz/115-CZ-Letecka-technika-L159.html</a>]]></title_description> </item> <item src="img_6813.jpg"> - <nofullsize /> <title>L-159 ALCA</title> <title_description><![CDATA[<a href="http://www.airshow.cz/115-CZ-Letecka-technika-L159.html">http://www.airshow.cz/115-CZ-Letecka-technika-L159.html</a>]]></title_description> </item> <item src="img_6815.jpg"> - <nofullsize /> <title>L-159 ALCA</title> <title_description><![CDATA[<a href="http://www.airshow.cz/115-CZ-Letecka-technika-L159.html">http://www.airshow.cz/115-CZ-Letecka-technika-L159.html</a>]]></title_description> </item> <item src="img_6830.jpg"> - <nofullsize /> <title>Bell-412</title> <title_description> </title_description> </item> <item src="img_6855.jpg"> - <nofullsize /> <title>Péter Besenyei - EXTRA 300S</title> <title_description><![CDATA[<a href="http://www.airshow.cz/157-CZ-CIAF-07-Besenyei-Peter.html">http://www.airshow.cz/157-CZ-CIAF-07-Besenyei-Peter.html</a>]]></title_description> </item> <item src="img_6857.jpg"> - <nofullsize /> <title>Péter Besenyei - EXTRA 300S</title> <title_description><![CDATA[<a href="http://www.airshow.cz/157-CZ-CIAF-07-Besenyei-Peter.html">http://www.airshow.cz/157-CZ-CIAF-07-Besenyei-Peter.html</a>]]></title_description> </item> @@ -133,6 +133,8 @@ parse_setup_xml (const char *filename, TGallerySetup *setup) setup->use_inpage_links = s ? strcasecmp (s, "yes") == 0 : TRUE; /* default to TRUE */ if (s) g_free (s); + setup->nofullsize = xml_file_get_node_present (xml, "/gallery_setup/images/nofullsize"); + xml_parser_close (xml); #ifdef __DEBUG_ALL__ @@ -54,6 +54,7 @@ typedef struct { unsigned long preview_portrait_height; char *border_style; + gboolean nofullsize; gboolean preload; gboolean use_iptc_exif; |
