changeset 568:04d4bdf5a2d8

exif_get_description_by_key(): check for "formatted." prefix, and optimize.
author zas_
date Sat, 03 May 2008 20:55:16 +0000
parents 2af11dbee6db
children fd51eac09ead
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);
 }