changeset 922:826d5862f671

Minor tidy up.
author zas_
date Wed, 23 Jul 2008 17:38:04 +0000
parents b416159a5820
children 893cd191db23
files src/exif-common.c
diffstat 1 files changed, 12 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/exif-common.c	Wed Jul 23 12:46:35 2008 +0000
+++ b/src/exif-common.c	Wed Jul 23 17:38:04 2008 +0000
@@ -89,11 +89,10 @@
 static double get_crop_factor(ExifData *exif)
 {
 	double res_unit_tbl[] = {0.0, 25.4, 25.4, 10.0, 1.0, 0.001 };
-
 	double xres = exif_get_rational_as_double(exif, "Exif.Photo.FocalPlaneXResolution");
 	double yres = exif_get_rational_as_double(exif, "Exif.Photo.FocalPlaneYResolution");
-	int res_unit;
-	int w, h;
+	gint res_unit;
+	gint w, h;
 	double xsize, ysize, size, ratio;
 
 	if (xres == 0.0 || yres == 0.0) return 0.0;
@@ -126,7 +125,7 @@
 	if (suffix_len < 0) suffix_len = strlen(suffix);
 	if (str_len < suffix_len) return FALSE;
 	
-	if (strcmp(str + str_len - suffix_len, suffix) != 0) return FALSE; 
+	if (strcmp(str + str_len - suffix_len, suffix) != 0) return FALSE;
 	str[str_len - suffix_len] = '\0';
 	
 	return TRUE;
@@ -275,14 +274,12 @@
 		}
 
 	f = exif_get_rational_as_double(exif, "Exif.Photo.FocalLength");
-	c = get_crop_factor(exif);
+	if (f == 0.0) return NULL;
 
-	if (f != 0.0 && c != 0.0)
-		{
-		return g_strdup_printf("%.0f mm", f * c);
-		}
+	c = get_crop_factor(exif);
+	if (c == 0.0) return NULL;
 
-	return NULL;
+	return g_strdup_printf("%.0f mm", f * c);
 }
 
 static gchar *exif_build_formatted_ISOSpeedRating(ExifData *exif)
@@ -385,7 +382,7 @@
 {
 	const gchar *name = "";
 	const gchar *source = "";
-	unsigned char *profile_data;
+	guchar *profile_data;
 	guint profile_len;
 
 	profile_data = exif_get_color_profile(exif, &profile_len);
@@ -461,7 +458,7 @@
 
 		if (key_valid) *key_valid = TRUE;
 
-		key = key + 10;
+		key += 10;
 		for (i = 0; ExifFormattedList[i].key; i++)
 			if (strcmp(key, ExifFormattedList[i].key + 10) == 0)
 				return ExifFormattedList[i].build_func(exif);
@@ -473,13 +470,13 @@
 
 const gchar *exif_get_description_by_key(const gchar *key)
 {
-	gint i;
-
 	if (!key) return NULL;
 
 	if (strncmp(key, "formatted.", 10) == 0)
 		{
-		key = key + 10;
+		gint i;
+
+		key += 10;
 		for (i = 0; ExifFormattedList[i].key; i++)
 			if (strcmp(key, ExifFormattedList[i].key + 10) == 0)
 				return _(ExifFormattedList[i].description);
@@ -557,7 +554,6 @@
 			}
 		}
 
-
 	fd->exif = exif_read(fd->path, sidecar_path);
 	return fd->exif;
 }