diff options
| -rw-r--r-- | src/generators.c | 18 | ||||
| -rw-r--r-- | templates/template_picture.html | 4 |
2 files changed, 5 insertions, 17 deletions
diff --git a/src/generators.c b/src/generators.c index dbf6667..b1c7b44 100644 --- a/src/generators.c +++ b/src/generators.c @@ -683,8 +683,10 @@ write_html_image (TGallerySetup *setup, /* Retrieve image sizes of preview and original image */ get_image_sizes (img_dst, &img_w, &img_h); image_fullsize = ! theme_size_is_original && img_orig_dst != NULL && ! IS_NOFULLSIZE (item, parent_items, setup); - if (image_fullsize) + if (image_fullsize) { get_image_sizes (img_orig_dst, &img_orig_w, &img_orig_h); + g_hash_table_replace (defines, g_strdup ("HAS_FULLSIZE"), g_strdup ("")); + } /* Get title and description from IPTC/EXIF/JPEG if not defined */ title = g_strdup (item->title); @@ -872,26 +874,12 @@ write_html_image (TGallerySetup *setup, } - /* Setup block parser */ - block_parser_register_key (block_parser, "IMG_FULLSIZE_LINK", "IMG_FULLSIZE_LINK"); - - /* Read through the template and replace placeholders with real data */ while (! feof (fin)) { line = block_parser_read_and_parse (block_parser, fin); if (line == NULL) break; - /* Blocks */ - if (block_parser_has_unused_data (block_parser, "IMG_FULLSIZE_LINK")) { - block = block_parser_get_data (block_parser, "IMG_FULLSIZE_LINK"); - if (block) { - replace_table_process (&block, replace_table); - replace_table_add_key (replace_table, "IMG_FULLSIZE_LINK", image_fullsize ? block : ""); - } - g_free (block); - } - /* Replace all known tags */ replace_table_process (&line, replace_table); diff --git a/templates/template_picture.html b/templates/template_picture.html index bce658e..973ef2b 100644 --- a/templates/template_picture.html +++ b/templates/template_picture.html @@ -34,11 +34,11 @@ <!-- ## Image --> <div class="img_preview"> <a href="$(LINK_NEXT)"><img src="$(IMG_SRC)" width="$(IMG_SIZE_W)" height="$(IMG_SIZE_H)" alt="" id="$(value(BORDER_STYLE))" /></a> - <!-- $(BEGIN_IMG_FULLSIZE_LINK) --> + <!-- $(ifdef(HAS_FULLSIZE)) --> <div class="img_preview_full"> <a href="$(IMG_SRC_FULL)">See original size (<!-- $(IMG_SIZE_ORIG_W) -->x<!-- $(IMG_SIZE_ORIG_H) -->)</a> </div> - <!-- $(END_IMG_FULLSIZE_LINK) --> + <!-- $(endif(HAS_FULLSIZE)) --> </div> <!-- $(ifdef(SHOW_EXIF_TABLE)) --> |
