diff src/image.c @ 424:26c6e768bd47

first support for AdobeRGB colorspace
author nadvornik
date Sat, 19 Apr 2008 16:26:29 +0000
parents 4f7362028062
children 9fe0ca1b5263
line wrap: on
line diff
--- a/src/image.c	Sat Apr 19 16:10:08 2008 +0000
+++ b/src/image.c	Sat Apr 19 16:26:29 2008 +0000
@@ -382,16 +382,28 @@
 		if (!item)
 			{
 			gint cs;
+			gchar *interop_index;
 
 			/* ColorSpace == 1 specifies sRGB per EXIF 2.2 */
-			if (exif_get_integer(exif, "Exif.Photo.ColorSpace", &cs) &&
-			    cs == 1)
+			if (!exif_get_integer(exif, "Exif.Photo.ColorSpace", &cs)) cs = 0;
+			interop_index = exif_get_data_as_text(exif, "Exif.Iop.InteroperabilityIndex");			
+			
+			if (cs == 1)
 				{
 				input_type = COLOR_PROFILE_SRGB;
 				input_file = NULL;
 
 				if (debug) printf("Found EXIF ColorSpace of sRGB\n");
 				}
+			if (cs == 2 || (interop_index && !strcmp(interop_index, "R03")))
+				{
+				input_type = COLOR_PROFILE_ADOBERGB;
+				input_file = NULL;
+
+				if (debug) printf("Found EXIF ColorSpace of AdobeRGB\n");
+				}
+				
+			g_free(interop_index);
 			}
 		}