summaryrefslogtreecommitdiff
path: root/src/generators.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/generators.c')
-rw-r--r--src/generators.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/generators.c b/src/generators.c
index 48f7c0b..a6e0ba0 100644
--- a/src/generators.c
+++ b/src/generators.c
@@ -575,7 +575,9 @@ write_html_image (TGallerySetup *setup,
char *big_dst;
char *orig_dst;
char *buf_img_fullsize_link;
+ char *buf_exif_table;
gboolean in_img_fullsize_link;
+ gboolean in_exif_table;
TExifData *exif;
unsigned long img_big_w, img_big_h, img_orig_w, img_orig_h;
unsigned int item_index, real_item_index, real_total_items;
@@ -652,6 +654,9 @@ write_html_image (TGallerySetup *setup,
buf_img_fullsize_link = malloc (BUFFER_SIZE);
memset (buf_img_fullsize_link, 0, BUFFER_SIZE);
in_img_fullsize_link = FALSE;
+ buf_exif_table = malloc (BUFFER_SIZE);
+ memset (buf_exif_table, 0, BUFFER_SIZE);
+ in_exif_table = FALSE;
res = TRUE;
/* Get EXIF data from the original image */
@@ -854,15 +859,31 @@ write_html_image (TGallerySetup *setup,
if (! image_fullsize) /* write down the block later in this cycle */
continue;
}
+ if (strstr (buffer, "<!-- $(BEGIN_EXIF_TABLE) -->")) {
+ in_exif_table = TRUE;
+ continue;
+ }
+ if (strstr (buffer, "<!-- $(END_EXIF_TABLE) -->")) {
+ in_exif_table = FALSE;
+ if (! setup->show_exif_table)
+ continue;
+ }
if (in_img_fullsize_link) {
buf_img_fullsize_link = strncat (buf_img_fullsize_link, buffer, BUFFER_SIZE - strlen (buf_img_fullsize_link) - 2);
continue;
}
+ if (in_exif_table) {
+ buf_exif_table = strncat (buf_exif_table, buffer, BUFFER_SIZE - strlen (buf_exif_table) - 2);
+ continue;
+ }
/* Select apropriate line buffer */
if (strstr (buffer, "<!-- $(END_IMG_FULLSIZE_LINK) -->") && image_fullsize) {
b = strdup (buf_img_fullsize_link);
} else
+ if (strstr (buffer, "<!-- $(END_EXIF_TABLE) -->") && setup->show_exif_table) {
+ b = strdup (buf_exif_table);
+ } else
b = strdup (buffer);
/* Replace all known tags */
@@ -886,6 +907,7 @@ write_html_image (TGallerySetup *setup,
free (big_dst);
free (orig_dst);
free (buf_img_fullsize_link);
+ free (buf_exif_table);
g_free (imgname);
if (preload_imgname)
g_free (preload_imgname);