changeset 568:77da13cb250b

exif_get_description_by_key(): check for "formatted." prefix, and optimize.
author Laurent Monin <geeqie@norz.org>
date Sat, 03 May 2008 20:55:16 +0000
parents 1ffddc1f6cf9
children f2389379600b
files src/exif-common.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/exif-common.c	Sat May 03 20:49:25 2008 +0000
+++ b/src/exif-common.c	Sat May 03 20:55:16 2008 +0000
@@ -476,9 +476,13 @@
 
 	if (!key) return NULL;
 
-	for (i = 0; ExifFormattedList[i].key; i++)
-		if (strcmp(key, ExifFormattedList[i].key) == 0)
-			return _(ExifFormattedList[i].description);
+	if (strncmp(key, "formatted.", 10) == 0)
+		{
+		key = key + 10;
+		for (i = 0; ExifFormattedList[i].key; i++)
+			if (strcmp(key, ExifFormattedList[i].key + 10) == 0)
+				return _(ExifFormattedList[i].description);
+		}
 
 	return exif_get_tag_description_by_key(key);
 }