# HG changeset patch # User Colin Clark # Date 1542485253 0 # Node ID 9104756a782896646b6cbdfbf9384a5662f30a18 # Parent 4b92a65f836710619510c48d1f537bf08c5b6544 Show timezone data when no date-time Make available GPS lat/long derived data Timezone, Country Name, Country Code even when there is no GPS date and time available. diff -r 4b92a65f8367 -r 9104756a7828 src/exif-common.c --- a/src/exif-common.c Sat Nov 17 19:48:35 2018 +0000 +++ b/src/exif-common.c Sat Nov 17 20:07:33 2018 +0000 @@ -662,7 +662,7 @@ /** * @brief Gets timezone data from an exif structure * @param[in] exif - * @returns TRUE if timezone data found + * @returns TRUE if timezone data found AND GPS date and time found * @param[out] exif_date_time exif date/time in the form 2018:11:30:17:05:04 * @param[out] timezone in the form "Europe/London" * @param[out] countryname in the form "United Kingdom" @@ -696,11 +696,8 @@ text_date = exif_get_data_as_text(exif, "Exif.GPSInfo.GPSDateStamp"); text_time = exif_get_data_as_text(exif, "Exif.GPSInfo.GPSTimeStamp"); - if (text_latitude && text_longitude && text_latitude_ref && - text_longitude_ref && text_date && text_time) + if (text_latitude && text_longitude && text_latitude_ref && text_longitude_ref) { - *exif_date_time = g_strconcat(text_date, ":", text_time, NULL); - lat_deg = strtok(text_latitude, "deg'"); lat_min = strtok(NULL, "deg'"); latitude = atof(lat_deg) + atof(lat_min) / 60; @@ -738,6 +735,14 @@ g_free(zd_path); } + if (ret && text_date && text_time) + { + *exif_date_time = g_strconcat(text_date, ":", text_time, NULL); + } + else + { + ret = FALSE; + } return ret; }