Skip to content

Commit

Permalink
Tag problematic DNG image files
Browse files Browse the repository at this point in the history
As commented in commit cf9d9f6 there a dng files still problematic for darktable.
While reading exif data they now automatically are tagged with "darktable|issue|no-samples"
so they can be found easily by the user.
  • Loading branch information
jenshannoschwalm committed Oct 21, 2024
1 parent 7dbd9e6 commit d6dfb5e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/common/exif.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1802,6 +1802,8 @@ static bool _exif_decode_exif_data(dt_image_t *img, Exiv2::ExifData &exifData)
// Read embedded color matrix and DNG related tags.
if(FIND_EXIF_TAG("Exif.Image.DNGVersion"))
{
gboolean missing_sample = FALSE;

// initialize matrixes and data with noop / defaults
float CM[3][9];
float FM[3][9];
Expand Down Expand Up @@ -1933,12 +1935,13 @@ static bool _exif_decode_exif_data(dt_image_t *img, Exiv2::ExifData &exifData)
{
const gboolean anymat = has_CM[k] || has_CC[k] || has_FM[k];

// Currently dt does not support DT_LS_Other so we do a fallback but backreport and request a github issue
// Currently dt does not support DT_LS_Other so we do a fallback but backreport and request samples
if(illu[k] == DT_LS_Other)
{
dt_control_log(_("detected OtherIlluminant in `%s`, please report via darktable github"), img->filename);
dt_print(DT_DEBUG_IMAGEIO, "detected not-implemented OtherIlluminant in `%s`, please report via darktable github", img->filename);
illu[k] = DT_LS_D65;
missing_sample = TRUE;
}

if(illu[k] != DT_LS_Unknown)
Expand Down Expand Up @@ -1986,6 +1989,7 @@ static bool _exif_decode_exif_data(dt_image_t *img, Exiv2::ExifData &exifData)
{
dt_control_log(_("special exif illuminants in `%s`, please report via darktable github"), img->filename);
dt_print(DT_DEBUG_ALWAYS, "special exif illuminants in `%s`, please report via darktable github", img->filename);
missing_sample = TRUE;
}


Expand All @@ -2012,6 +2016,7 @@ static bool _exif_decode_exif_data(dt_image_t *img, Exiv2::ExifData &exifData)
if(forward_suggested)
{
dt_control_log(_("forward matrix in `%s`, please report via darktable github"), img->filename);
missing_sample = TRUE;
}
dt_print(DT_DEBUG_IMAGEIO,
"[exif] %s%s%s: selected from [1] %s (%iK), [2] %s (%iK), [3] %s (%iK)",
Expand All @@ -2031,6 +2036,14 @@ static bool _exif_decode_exif_data(dt_image_t *img, Exiv2::ExifData &exifData)
mat3mul(img->d65_color_matrix, illuminant_data[illuminant].CA, cameratoXYZ);
_print_matrix_data("dt_image_t d65_color_matrix", 0, img->d65_color_matrix);
}
if(missing_sample)
{
guint tagid = 0;
char tagname[32];
snprintf(tagname, sizeof(tagname), "darktable|issue|no-samples");
dt_tag_new(tagname, &tagid);
dt_tag_attach(tagid, img->id, FALSE, FALSE);
}
}

gboolean is_monochrome = FALSE;
Expand Down

0 comments on commit d6dfb5e

Please sign in to comment.