diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2012-12-27 20:29:37 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2012-12-27 20:29:37 +0100 |
| commit | d0599f8ab5c38e14845407dea4eef4d4957f9e28 (patch) | |
| tree | 14d5636e8a4213c06ab4144e5ae32a88f4ddbc8b /src/generators.c | |
| parent | dfb9d91c3342d9415a41e98d3a4af7d8c7472c6b (diff) | |
| download | cataract-d0599f8ab5c38e14845407dea4eef4d4957f9e28.tar.xz | |
Support external EXIF metadata
This brings an ability to specify external file to read EXIF/IPTC
data from. The motivation was to work around RAW editors randomly
stripping some EXIF blocks.
Diffstat (limited to 'src/generators.c')
| -rw-r--r-- | src/generators.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/generators.c b/src/generators.c index ab7ab12..d5f1837 100644 --- a/src/generators.c +++ b/src/generators.c @@ -706,9 +706,17 @@ write_html_image (TGallerySetup *setup, if (next_item && setup->preload) get_image_paths (setup, parent_items, next_item, next_item_index, path_info, image_size, NULL, NULL, &preload_imgname); - /* Get EXIF data from the original image */ + /* Use external EXIF file if specified */ exif = NULL; - if (img_orig_src) { + if (item->metadata_external_exif) { + s1 = g_build_filename (path_info->src_dir, item->metadata_external_exif, NULL); + exif = read_exif (s1); + if (exif == NULL) + log_error ("write_html_image: error getting exif data from file \"%s\"\n", s1); + g_free (s1); + } + /* Get EXIF data from the original image */ + if (exif == NULL && img_orig_src) { exif = read_exif (img_orig_src); if (exif == NULL) log_error ("write_html_image: error getting exif data from file \"%s\"\n", img_orig_src); |
