From 3980decf474580088e47eb7d1f6111fb3da79c97 Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Tue, 22 Sep 2026 21:49:00 -0300
Subject: Add support for LittleCMS 2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Use the current lcms2 pkg-config module and public header for the camera codec. Remove the obsolete LittleCMS 1 cmsErrorAction compatibility call.

LittleCMS 2 profile opening, transform creation, and transform execution remain unchanged. Invalid input profiles continue to be rejected when cmsOpenProfileFromFile returns null.

Tests:
- camera decoder built against LittleCMS 2
- valid and invalid profiles exercised through apply_profile()
- binary verified against liblcms2.so.2 with no LCMS1 linkage
- git diff --check

Signed-off-by: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
---
 ConfigureChecks.cmake     | 4 ++--
 kernel/kls_camera/dcraw.c | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 27f8503..d22cf72 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -29,9 +29,9 @@ endif( WITH_GCC_VISIBILITY )
 ##### check for lcms #####
 
 if( WITH_LCMS )
-  pkg_search_module( LCMS lcms )
+  pkg_search_module( LCMS lcms2 )
   if( NOT LCMS_FOUND )
-    tde_message_fatal( "lcms was requested but was not found on your system" )
+    tde_message_fatal( "lcms2 was requested but was not found on your system" )
   endif()
 endif( )
 
diff --git a/kernel/kls_camera/dcraw.c b/kernel/kls_camera/dcraw.c
index 0eea8e1..4a9a7fa 100644
--- a/kernel/kls_camera/dcraw.c
+++ b/kernel/kls_camera/dcraw.c
@@ -47,7 +47,7 @@
 #include <jpeglib.h>
 #endif
 #ifndef NO_LCMS
-#include <lcms.h>
+#include <lcms2.h>
 #endif
 #ifdef LOCALEDIR
 #include <libintl.h>
@@ -7486,7 +7486,6 @@ void CLASS apply_profile (char *input, char *output)
   FILE *fp;
   unsigned size;
 
-  cmsErrorAction (LCMS_ERROR_SHOW);
   if (strcmp (input, "embed"))
     hInProfile = cmsOpenProfileFromFile (input, "r");
   else if (profile_length) {
-- 
cgit v1.2.3

