cam_xyz is not available for DNG files


I noticed that imgdata.color.cam_xyz is not available for DNG files, even for cameras for which it is available in their native format. It is written in adobe_coeff(). DCRaw jumps over the code that calls to adobe_coeff() when the file is DNG. Then, it loads the cam_xyz information in parse_tiff_ifd(), but it is not copied into imgdata.color.cam_xyz. So, I suggest you copy it at the end of parse_tiff_ifd(), similarly to what is done in adobe_coeff(). Something like:

  if (use_cm) {
    FORCC for (i=0; i < 3; i++)
      for (cam_xyz[c][i]=j=0; j < colors; j++)
        imgdata.color.cam_xyz[c][i] =
        cam_xyz[c][i] += cc[c][j] * cm[j][i] * xyz[i];
    cam_xyz_coeff (cam_xyz);

Another posibility is to do this copy at the beginning of cam_xyz_coeff, which is called by both adobe_coeff() and parse_tiff_ifd().



This is already fixed in

This is already fixed in development branch (available at ) in two ways
1) Internal LibRaw color profile is copied to imgdata.color.cam_xyz[] ever for DNG files.
2) For DNG files full DNG color data preserved in imgdata.color.dng_color[2] (if DNG contains two color matrices, then both matrices are preserved)

-- Alex Tutubalin @LibRaw LLC