Fix lcms2 integration
authorKlaus Ethgen <Klaus@Ethgen.de>
Sat, 27 Sep 2014 11:07:10 +0000 (12:07 +0100)
committerKlaus Ethgen <Klaus@Ethgen.de>
Sat, 27 Sep 2014 11:07:10 +0000 (12:07 +0100)
Thanks Michael Schwendt <mschwendt@gmail.com> for the bug reporting and
the patch.

src/color-man.c

index 7788c7a..e4f1bab 100644 (file)
@@ -432,10 +432,12 @@ static gchar *color_man_get_profile_name(ColorManProfileType type, cmsHPROFILE p
                        if (profile)
                                {
 #ifdef HAVE_LCMS2
                        if (profile)
                                {
 #ifdef HAVE_LCMS2
-                               cmsUInt8Number profileID[17];
-                               profileID[16] = '\0';
-                               cmsGetHeaderProfileID(profile, profileID);
-                               return g_strdup((gchar *) profileID);
+                               cmsUInt32Number r;
+                               char buffer[20];
+                               buffer[0] = '\0';
+                               r = cmsGetProfileInfoASCII(profile, cmsInfoDescription, "en", "US", &buffer, 20);
+                               buffer[19] = '\0'; /* Just to be sure */
+                               return g_strdup(buffer);
 #else
                                return g_strdup(cmsTakeProductName(profile));
 #endif
 #else
                                return g_strdup(cmsTakeProductName(profile));
 #endif