Blame SOURCES/dcraw-9.21-lcms2-error-reporting.patch

9d2a02
From affda75b7d868350d7ef9e7a67367826fb3e950d Mon Sep 17 00:00:00 2001
9d2a02
From: Nils Philippsen <nils@redhat.com>
9d2a02
Date: Wed, 4 Sep 2013 17:13:49 +0200
9d2a02
Subject: [PATCH] Report errors with LCMS version 2.x.
9d2a02
9d2a02
---
9d2a02
 dcraw.c | 8 ++++++++
9d2a02
 1 file changed, 8 insertions(+)
9d2a02
9d2a02
diff --git a/dcraw.c b/dcraw.c
9d2a02
index 6f8dbbe..d80db64 100644
9d2a02
--- a/dcraw.c
9d2a02
+++ b/dcraw.c
9d2a02
@@ -8902,6 +8902,13 @@ notraw:
9d2a02
 }
9d2a02
 
9d2a02
 #ifndef NO_LCMS
9d2a02
+static void lcms2_error_show_handler (cmsContext ContextID,
9d2a02
+                                      cmsUInt32Number ErrorCode,
9d2a02
+                                      const char *Text)
9d2a02
+{
9d2a02
+  fprintf (stderr, "lcms2: Error #%d; %s\n", ErrorCode, Text);
9d2a02
+}
9d2a02
+
9d2a02
 void CLASS apply_profile (const char *input, const char *output)
9d2a02
 {
9d2a02
   char *prof;
9d2a02
@@ -8910,6 +8917,7 @@ void CLASS apply_profile (const char *input, const char *output)
9d2a02
   FILE *fp;
9d2a02
   unsigned size;
9d2a02
 
9d2a02
+  cmsSetLogErrorHandler (lcms2_error_show_handler);
9d2a02
   if (strcmp (input, "embed"))
9d2a02
     hInProfile = cmsOpenProfileFromFile (input, "r");
9d2a02
   else if (profile_length) {
9d2a02
-- 
9d2a02
1.9.0
9d2a02