From 6f0b21b11f8711ef425069b277a1c743202174a7 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 15 Apr 2012 22:39:24 +0200 Subject: Add HAS_EXIF define This brings a new HAS_EXIF define which is present when EXIF information are available. Templates have been modified to inform user when not available. The test for EXIF metadata presence is fairly basic, we only look for aperture, focal length and exposure time attributes. This might be a subject to change in the future. --- src/generators.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/generators.c') diff --git a/src/generators.c b/src/generators.c index 1d05eea..5fe87fe 100644 --- a/src/generators.c +++ b/src/generators.c @@ -707,6 +707,11 @@ write_html_image (TGallerySetup *setup, if (exif == NULL) log_error ("write_html_image: error getting exif data from file \"%s\"\n", img_dst); } + /* Test for basic EXIF keys presence */ + if (exif != NULL && exif_has_key (exif, EXIF_APERTURE) && + exif_has_key (exif, EXIF_FOCAL_LENGTH) && + exif_has_key (exif, EXIF_EXPOSURE)) + g_hash_table_replace (defines, g_strdup ("HAS_EXIF"), g_strdup ("")); /* Retrieve image sizes of preview and original image */ get_image_sizes (img_dst, &img_w, &img_h, setup->autorotate); -- cgit v1.2.3