Mercurial > geeqie
diff src/exif-common.c @ 1189:9e424170e958
Do not hardcode exif formatted prefix.
author | zas_ |
---|---|
date | Thu, 27 Nov 2008 19:10:59 +0000 |
parents | 3692efcbd325 |
children | 43bfcbb62cd6 |
line wrap: on
line diff
--- a/src/exif-common.c Thu Nov 27 12:34:39 2008 +0000 +++ b/src/exif-common.c Thu Nov 27 19:10:59 2008 +0000 @@ -503,7 +503,7 @@ /* List of custom formatted pseudo-exif tags */ -#define EXIF_FORMATTED_TAG(name, label) { "formatted."#name, label, exif_build_formatted##_##name } +#define EXIF_FORMATTED_TAG(name, label) { EXIF_FORMATTED()#name, label, exif_build_formatted##_##name } ExifFormattedText ExifFormattedList[] = { EXIF_FORMATTED_TAG(Camera, N_("Camera")), @@ -525,15 +525,15 @@ gchar *exif_get_formatted_by_key(ExifData *exif, const gchar *key, gint *key_valid) { - if (strncmp(key, "formatted.", 10) == 0) + if (strncmp(key, EXIF_FORMATTED(), EXIF_FORMATTED_LEN) == 0) { gint i; if (key_valid) *key_valid = TRUE; - key += 10; + key += EXIF_FORMATTED_LEN; for (i = 0; ExifFormattedList[i].key; i++) - if (strcmp(key, ExifFormattedList[i].key + 10) == 0) + if (strcmp(key, ExifFormattedList[i].key + EXIF_FORMATTED_LEN) == 0) return ExifFormattedList[i].build_func(exif); } @@ -545,13 +545,13 @@ { if (!key) return NULL; - if (strncmp(key, "formatted.", 10) == 0) + if (strncmp(key, EXIF_FORMATTED(), EXIF_FORMATTED_LEN) == 0) { gint i; - key += 10; + key += EXIF_FORMATTED_LEN; for (i = 0; ExifFormattedList[i].key; i++) - if (strcmp(key, ExifFormattedList[i].key + 10) == 0) + if (strcmp(key, ExifFormattedList[i].key + EXIF_FORMATTED_LEN) == 0) return g_strdup(_(ExifFormattedList[i].description)); }