[Rawstudio-commit] r1982 - trunk/src

Anders Kvist anders at kvistmail.dk
Wed Sep 3 21:20:47 CEST 2008


Author: akv
Date: 2008-09-03 21:20:47 +0200 (Wed, 03 Sep 2008)
New Revision: 1982

Modified:
   trunk/src/rs-cms.c
   trunk/src/rs-cms.h
Log:
Added cms_get_profile_info_from_file().

Modified: trunk/src/rs-cms.c
===================================================================
--- trunk/src/rs-cms.c	2008-09-03 18:20:02 UTC (rev 1981)
+++ trunk/src/rs-cms.c	2008-09-03 19:20:47 UTC (rev 1982)
@@ -395,3 +395,30 @@
 	wIn[2] = gammatable22[*(LPWORD) accum]; accum+= 2;
 	return(accum);
 }
+
+gboolean
+cms_get_profile_info_from_file(const gchar *filename, gchar **name, gchar **info, gchar **description)
+{
+	gboolean ret = FALSE;
+	cmsHPROFILE profile;
+
+	g_assert(filename);
+
+	CMS_LOCK();
+	if ((profile = cmsOpenProfileFromFile(filename, "r")))
+	{
+		if (name)
+			*name = g_strdup(cmsTakeProductName(profile));
+
+		if (info)
+			*info = g_strdup(cmsTakeProductInfo(profile));
+
+		if (description)
+			*info = g_strdup(cmsTakeProductDesc(profile));
+
+		ret = TRUE;
+	}
+	CMS_UNLOCK();
+
+	return ret;
+}

Modified: trunk/src/rs-cms.h
===================================================================
--- trunk/src/rs-cms.h	2008-09-03 18:20:02 UTC (rev 1981)
+++ trunk/src/rs-cms.h	2008-09-03 19:20:47 UTC (rev 1982)
@@ -47,5 +47,6 @@
 extern void rs_cms_prepare_transforms(RS_CMS *cms);
 extern void rs_cms_do_transform(gpointer transform, gpointer input, gpointer output, guint size);
 extern RS_CMS *rs_cms_init(void);
+extern gboolean cms_get_profile_info_from_file(const gchar *filename, gchar **name, gchar **info, gchar **description);
 
 #endif /* RS_CMS_H */




More information about the Rawstudio-commit mailing list