diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/generators.c | 22 | ||||
| -rw-r--r-- | src/setup.c | 3 | ||||
| -rw-r--r-- | src/setup.h | 1 |
3 files changed, 26 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); diff --git a/src/setup.c b/src/setup.c index 4755ad7..f328196 100644 --- a/src/setup.c +++ b/src/setup.c @@ -138,6 +138,9 @@ parse_setup_xml (const char *filename, TGallerySetup *setup) s = xml_file_get_node_attribute (xml, "/gallery_setup/navigation/show_go_up", "value"); setup->show_go_up = s ? strcasecmp (s, "yes") == 0 : TRUE; /* default to TRUE */ if (s) g_free (s); + s = xml_file_get_node_attribute (xml, "/gallery_setup/navigation/show_exif_table", "value"); + setup->show_exif_table = 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"); diff --git a/src/setup.h b/src/setup.h index 4019184..5bc0e1a 100644 --- a/src/setup.h +++ b/src/setup.h @@ -74,6 +74,7 @@ typedef struct { char *add_copyright; gboolean use_inpage_links; gboolean show_go_up; + gboolean show_exif_table; char *favicon_file; char *favicon_type; |
