Index: dcraw/dcraw_lz.c
===================================================================
--- dcraw.orig/dcraw_lz.c
+++ dcraw/dcraw_lz.c
@@ -140,7 +140,10 @@ int output_color=1, output_bps=8, output
 int no_auto_bright=0;
 unsigned greybox[4] = { 0, 0, UINT_MAX, UINT_MAX };
 float cam_mul[4], pre_mul[4], cmatrix[3][4], rgb_cam[3][4];
-const double xyz_rgb[3][3] = {			/* XYZ from RGB */
+#ifndef LIGHTZONE
+const
+#endif
+double xyz_rgb[3][3] = {			/* XYZ from RGB */
   { 0.412453, 0.357580, 0.180423 },
   { 0.212671, 0.715160, 0.072169 },
   { 0.019334, 0.119193, 0.950227 } };
@@ -10225,6 +10228,9 @@ int CLASS main (int argc, const char **a
 #ifndef NO_LCMS
   const char *cam_profile=0, *out_profile=0;
 #endif
+#ifdef LIGHTZONE
+  const char *ofbase = 0;
+#endif
 
 #ifndef LOCALTIME
   putenv ((char *) "TZ=UTC");
@@ -10319,6 +10325,9 @@ int CLASS main (int argc, const char **a
       case 'p':  cam_profile = argv[arg++];
 #endif
 	break;
+#ifdef LIGHTZONE
+      case 'F':  ofbase     = argv[arg++];  break;
+#endif
       case 'P':  bpfile     = argv[arg++];  break;
       case 'K':  dark_frame = argv[arg++];  break;
       case 'z':  timestamp_only    = 1;  break;
@@ -10347,6 +10356,19 @@ int CLASS main (int argc, const char **a
 	return 1;
     }
   }
+#ifdef LIGHTZONE
+  if (!half_size && !thumbnail_only) {
+    float rimm[3][3] = {
+      { 0.7977, 0.2880, 0.0000 },
+      { 0.1352, 0.7119, 0.0000 },
+      { 0.0313, 0.0001, 0.8249 } };
+    int i, j;
+
+    for (i=0; i < 3; ++i)
+      for (j=0; j < 3; ++j)
+        xyz_rgb[i][j] = rimm[j][i];
+  }
+#endif
   if (arg == argc) {
     fprintf (stderr,_("No files to process.\n"));
     return 1;
@@ -10491,6 +10513,10 @@ int CLASS main (int argc, const char **a
 	    for (c = i && putchar('/') && 0; c < fwide; c++)
 	      putchar (cdesc[fcol(i,c)]);
 	}
+#ifdef LIGHTZONE
+	printf(_("\nCamera RGB Profile:"));
+	for (i=0; i<3; ++i) FORCC printf(" %f", rgb_cam[i][c]);
+#endif
 	printf (_("\nDaylight multipliers:"));
 	FORCC printf (" %f", pre_mul[c]);
 	if (cam_mul[0] > 0) {
@@ -10603,6 +10629,11 @@ thumbnail:
     if (write_to_stdout)
       strcpy (ofname,_("standard output"));
     else {
+#ifdef LIGHTZONE
+      if (ofbase)
+        strcpy (ofname, ofbase);
+      else
+#endif
       strcpy (ofname, ifname);
       if ((cp = strrchr (ofname, '.'))) *cp = 0;
       if (multi_out)
@@ -10635,3 +10666,5 @@ cleanup:
   }
   return status;
 }
+
+/* vim:set noet sw=8 ts=8: */
