I am using ufraw from cvs and lcms 1.16 on NetBSD-current (i386).

I am one of the ufraw maintainers, although I haven't been particularly
active lately.  The current ufraw code has been crashing on me, and I
traced it to lcms objecting to profiles it was handed, and then ufraw
not checking for errors.  This message is about the profile problem
itself.

After one sets saturation, ufraw calls cmsCreateMultiprofileTransform
with an input profile (for the camera), and then a profile to increase
saturation which is tagged as Lab.  There's code in
cmsCreateMultiprofileTransform to deal with the current colorspace as
the profile chain is composed, but there's a shortcut for the case of
only 2 profiles and that fails with "Output profile is operating on
wrong colorspace".  I commented out the check for 2, so that the long
path will always be taken, and now ufraw runs and produces apparently
reasonable results.

--- src/cmsxform.c.orig 2006-12-13 06:39:40.000000000 -0500
+++ src/cmsxform.c
@@ -1775,7 +1775,7 @@ cmsHTRANSFORM LCMSEXPORT cmsCreateMultip
     // There is a simple case with just two profiles, try to catch it in order 
of getting
     // black preservation to work on this function, at least with two profiles.
 
-    if (nProfiles == 2) {
+    if (0 && nProfiles == 2) {
 
         if ((cmsGetDeviceClass(hProfiles[0]) != icSigLinkClass) && 
             (cmsGetDeviceClass(hProfiles[1]) != icSigLinkClass)) 


I don't quite follow all the steps in cmsCreateMultiprofileTransform,
but it seems that more sophisticated checking of colorspaces and
accomodating them is needed in the shortcut.

    Greg


From: Greg Troxel <[EMAIL PROTECTED]>
To: ufraw-devel <[EMAIL PROTECTED]>
Date: Sun, 15 Apr 2007 12:14:37 -0400
Message-ID: <[EMAIL PROTECTED]>
User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (berkeley-unix)
Subject: [UFRaw-Devel] lcms error messages if saturation != 1
MIME-Version: 1.0

I'm running the latest ufraw cvs with lcms 1.16 on NetBSD-current
(i386), not using gimp (just standalone ufraw).

I've rebuilt ufraw totally, and I'm pretty sure my libraries are all ok.
The error belong does not feel like a library version mismatch.

Things mostly work, but setting saturation (e.g. to 1.1) results in an
lcms error.  I set a breakpoint on ufraw_message because ufraw shortly
thereafter segfaults, but really the interesting issue is what triggers
the lcms complaint.

#0  ufraw_message (code=12288,
    format=0xbfbcafb8 "Output profile is operating on wrong colorspace")
    at ufraw_ufraw.c:74
#1  0xbba568c3 in cmsSignalError () from /usr/pkg/lib/liblcms.so.1
#2  0xbba6b6ea in cmsCreateProofingTransform () from /usr/pkg/lib/liblcms.so.1
#3  0xbba6c0ea in cmsCreateTransform () from /usr/pkg/lib/liblcms.so.1
#4  0xbba6c365 in cmsCreateMultiprofileTransform ()
   from /usr/pkg/lib/liblcms.so.1
#5  0x08055315 in developer_create_transform (d=0x8578000,
    mode=display_developer) at ufraw_developer.c:234
#6  0x0806a2cd in render_raw_histogram (data=0xbfbd2b48)
    at ufraw_preview.c:630
#7  0xbbaac2e2 in g_source_is_destroyed () from /usr/pkg/lib/libglib-2.0.so.0
#8  0xbbaade72 in g_main_context_dispatch ()
   from /usr/pkg/lib/libglib-2.0.so.0
#9  0xbbab0dc2 in g_main_context_check () from /usr/pkg/lib/libglib-2.0.so.0
#10 0xbbab1077 in g_main_loop_run () from /usr/pkg/lib/libglib-2.0.so.0
#11 0xbb869871 in gtk_main () from /usr/pkg/lib/libgtk-x11-2.0.so.0
#12 0x08071b58 in ufraw_preview (uf=dwarf2_read_address: Corrupted DWARF 
expressio\
n.
) at ufraw_preview.c:3040
#13 0x08076515 in ufraw_chooser (conf=0xbfbf3e00, defPath=0x0)
    at ufraw_chooser.c:134
#14 0x080500cd in main (argc=1, argv=0xbfbfe7dc) at ufraw.c:117

in developer_create_transform, we're in the 

            /* Following code imitates the function
             * cmsCreateMultiprofileProofingTransform(),
             * which does not exist in lcms. */

case, which is taking a sequence of transforms and then adding a
proofing transform to render the output profile view in the display
profile.

printing *d in developer_create_transform, I see that luminosity_profile
is null, but saturationProfile is non-NULL.  I'm using a color matrix,
but othewise all sRGB profiles, with a D200 raw file.

prof[0] is the input profile
prof[1] has the saturationProfile
intent is perceptual

The softproofing flag is set (i'm not sure this is right, but changing
it to zero doesn't help)

Then, down in cms cmsCreateProofingTransform errors:

       if (!IsProperColorSpace(OutputProfile, OutputFormat, FALSE)) {
              cmsSignalError(LCMS_ERRC_ABORTED, "Output profile is operating on 
wrong colorspace");
              cmsDeleteTransform((cmsHTRANSFORM) p);
              return NULL;
       }

Here, OutputProfile is the saturation profile, which appears to be Lab,
while output format is TYPE_RGB_16.

I wonder if this is a bug in lcms, and it shouldn't optimize the
2-profile case if the 2nd profile isn't the requested space, or
something like that.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Lcms-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to