I found a patch that will enable lcms2 when compiling Geeqie-1.1.This
is Gitorious Commit 1548a68. There is a small bug in the patch that I
remedied by deleting one single line. The new patch is attached. Since
it changes configure.in, one should run autoconf before configuring.

Geeqie's colour rendition has improved with lcms2.

Niko Sauer



diff -Naur geeqie-1.1/configure.in geeqie_mod-1.1/configure.in
--- geeqie-1.1/configure.in     2012-08-12 22:13:40.000000000 +0200
+++ geeqie_mod-1.1/configure.in 2013-12-03 20:22:50.348578962 +0200
@@ -275,14 +275,21 @@
     [liblcms=$enableval], [liblcms=auto])
 
 if test "x${liblcms}" != "xno"; then
-  PKG_CHECK_MODULES(LCMS, [lcms >= 1.14],
+  PKG_CHECK_MODULES(LCMS, [lcms2 >= 2.0],
     [
       HAVE_LCMS=yes
-      AC_DEFINE(HAVE_LCMS, 1, [define to enable use of color profiles with 
lcms])
+      AC_DEFINE(HAVE_LCMS2, 1, [lcms2 is used])
     ],
     [
-      HAVE_LCMS=no
-      AC_MSG_WARN([$LCMS_PKG_ERRORS])
+    PKG_CHECK_MODULES(LCMS, [lcms >= 1.14],
+      [
+        HAVE_LCMS=yes
+        AC_DEFINE(HAVE_LCMS, 1, [define to enable use of color profiles with 
lcms])
+      ],
+      [
+        HAVE_LCMS=no
+        AC_MSG_WARN([$LCMS_PKG_ERRORS])
+      ])
     ])
 else
   HAVE_LCMS=disabled
diff -Naur geeqie-1.1/src/color-man.c geeqie_mod-1.1/src/color-man.c
--- geeqie-1.1/src/color-man.c  2012-08-12 22:13:41.000000000 +0200
+++ geeqie_mod-1.1/src/color-man.c      2013-12-03 20:15:11.014349489 +0200
@@ -21,7 +21,11 @@
 #ifdef HAVE_LCMS
 /*** color support enabled ***/
 
+#ifdef HAVE_LCMS2
+#include <lcms2.h>
+#else
 #include <lcms.h>
+#endif
 
 
 typedef struct _ColorManCache ColorManCache;
@@ -52,7 +56,9 @@
        if (init_done) return;
        init_done = TRUE;
 
+#ifndef HAVE_LCMS2
        cmsErrorAction(LCMS_ERROR_IGNORE);
+#endif
 }
 
 static cmsHPROFILE color_man_create_adobe_comp(void)
@@ -425,7 +431,14 @@
                case COLOR_PROFILE_FILE:
                        if (profile)
                                {
+#ifdef HAVE_LCMS2
+                               cmsUInt8Number profileID[17];
+                               profileID[16] = '\0';
+                               cmsGetHeaderProfileID(profile, profileID);
+                               return g_strdup(profileID);
+#else
                                return g_strdup(cmsTakeProductName(profile));
+#endif
                                }
                        return g_strdup(_("Custom profile"));
                        break;
diff -Naur geeqie-1.1/src/exif-common.c geeqie_mod-1.1/src/exif-common.c
--- geeqie-1.1/src/exif-common.c        2012-08-12 22:13:41.000000000 +0200
+++ geeqie_mod-1.1/src/exif-common.c    2013-12-03 20:15:11.017682586 +0200
@@ -23,10 +23,10 @@
 #ifdef HAVE_LCMS
 /*** color support enabled ***/
 
-#ifdef HAVE_LCMS_LCMS_H
-  #include <lcms/lcms.h>
+#ifdef HAVE_LCMS2
+#include <lcms2.h>
 #else
-  #include <lcms.h>
+#include <lcms.h>
 #endif
 #endif
 
@@ -413,6 +413,9 @@
 
 static gchar *exif_build_formatted_ColorProfile(ExifData *exif)
 {
+#ifdef HAVE_LCMS2
+       cmsUInt8Number profileID[17];
+#endif
        const gchar *name = "";
        const gchar *source = "";
        guchar *profile_data;
@@ -452,7 +455,13 @@
                        profile = cmsOpenProfileFromMem(profile_data, 
profile_len);
                        if (profile)
                                {
+#ifdef HAVE_LCMS2
+                               profileID[16] = '\0';
+                               cmsGetHeaderProfileID(profile, profileID);
+                               name = profileID;
+#else
                                name = cmsTakeProductName(profile);
+#endif
                                cmsCloseProfile(profile);
                                }
                        g_free(profile_data);

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Geeqie-devel mailing list
Geeqie-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geeqie-devel

Reply via email to