|
|
c1da72 |
From 789b763bff1701ef31bd077ae49671dfe1c82a51 Mon Sep 17 00:00:00 2001
|
|
|
c1da72 |
From: Nils Philippsen <nils@redhat.com>
|
|
|
c1da72 |
Date: Wed, 4 Sep 2013 17:13:49 +0200
|
|
|
c1da72 |
Subject: [PATCH] Add support for LCMS version 2.x.
|
|
|
c1da72 |
|
|
|
c1da72 |
---
|
|
|
c1da72 |
dcraw.c | 21 ++++++++++++++++++++-
|
|
|
c1da72 |
1 file changed, 20 insertions(+), 1 deletion(-)
|
|
|
c1da72 |
|
|
|
c1da72 |
diff --git a/dcraw.c b/dcraw.c
|
|
|
c1da72 |
index 96e3d1f..4b280b5 100644
|
|
|
c1da72 |
--- a/dcraw.c
|
|
|
c1da72 |
+++ b/dcraw.c
|
|
|
c1da72 |
@@ -80,7 +80,13 @@ typedef unsigned long long UINT64;
|
|
|
c1da72 |
#include <jpeglib.h> /* Decode compressed Kodak DC120 photos */
|
|
|
c1da72 |
#endif /* and Adobe Lossy DNGs */
|
|
|
c1da72 |
#ifndef NO_LCMS
|
|
|
c1da72 |
-#include <lcms.h> /* Support color profiles */
|
|
|
c1da72 |
+#ifdef USE_LCMS2
|
|
|
c1da72 |
+#include <lcms2.h> /* Support color profiles */
|
|
|
c1da72 |
+#else
|
|
|
c1da72 |
+#undef USE_LCMS1
|
|
|
c1da72 |
+#define USE_LCMS1
|
|
|
c1da72 |
+#include <lcms.h>
|
|
|
c1da72 |
+#endif
|
|
|
c1da72 |
#endif
|
|
|
c1da72 |
#ifdef LOCALEDIR
|
|
|
c1da72 |
#include <libintl.h>
|
|
|
c1da72 |
@@ -8581,6 +8587,15 @@ notraw:
|
|
|
c1da72 |
}
|
|
|
c1da72 |
|
|
|
c1da72 |
#ifndef NO_LCMS
|
|
|
c1da72 |
+#ifdef USE_LCMS2
|
|
|
c1da72 |
+static void lcms2_error_show_handler (cmsContext ContextID,
|
|
|
c1da72 |
+ cmsUInt32Number ErrorCode,
|
|
|
c1da72 |
+ const char *Text)
|
|
|
c1da72 |
+{
|
|
|
c1da72 |
+ fprintf (stderr, "lcms2: Error #%d; %s\n", ErrorCode, Text);
|
|
|
c1da72 |
+}
|
|
|
c1da72 |
+#endif
|
|
|
c1da72 |
+
|
|
|
c1da72 |
void CLASS apply_profile (const char *input, const char *output)
|
|
|
c1da72 |
{
|
|
|
c1da72 |
char *prof;
|
|
|
c1da72 |
@@ -8589,7 +8604,11 @@ void CLASS apply_profile (const char *input, const char *output)
|
|
|
c1da72 |
FILE *fp;
|
|
|
c1da72 |
unsigned size;
|
|
|
c1da72 |
|
|
|
c1da72 |
+#ifdef USE_LCMS2
|
|
|
c1da72 |
+ cmsSetLogErrorHandler (lcms2_error_show_handler);
|
|
|
c1da72 |
+#else
|
|
|
c1da72 |
cmsErrorAction (LCMS_ERROR_SHOW);
|
|
|
c1da72 |
+#endif
|
|
|
c1da72 |
if (strcmp (input, "embed"))
|
|
|
c1da72 |
hInProfile = cmsOpenProfileFromFile (input, "r");
|
|
|
c1da72 |
else if (profile_length) {
|
|
|
c1da72 |
--
|
|
|
c1da72 |
1.8.3.1
|
|
|
c1da72 |
|