From 19f17f2cc36986b72a0c8d1f3a67c91deaf8e32d Mon Sep 17 00:00:00 2001 From: Hanno Schwalm Date: Sat, 10 Jan 2026 13:10:57 +0100 Subject: [PATCH 1/2] Various log improvements - dt_colorspace_get_name() got better strings for NONE and FILE - in mipmap and pixelpipe we don't report CPU if in generic part of the code - we always want the dt_print...() variants to be used --- src/common/colorspaces.c | 4 ++-- src/common/mipmap_cache.c | 12 ++++++------ src/develop/pixelpipe_hb.c | 3 +-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/common/colorspaces.c b/src/common/colorspaces.c index b03573b12c7c..69c62aff477b 100644 --- a/src/common/colorspaces.c +++ b/src/common/colorspaces.c @@ -1732,9 +1732,9 @@ const char *dt_colorspaces_get_name(dt_colorspaces_color_profile_type_t type, switch(type) { case DT_COLORSPACE_NONE: - return NULL; + return _("DT_COLORSPACE_NONE"); case DT_COLORSPACE_FILE: - return filename; + return filename && filename[0] ? filename : _("no filename"); case DT_COLORSPACE_SRGB: return _("sRGB"); case DT_COLORSPACE_ADOBERGB: diff --git a/src/common/mipmap_cache.c b/src/common/mipmap_cache.c index 19cc83122ca4..14b18640f1d6 100644 --- a/src/common/mipmap_cache.c +++ b/src/common/mipmap_cache.c @@ -1322,7 +1322,7 @@ static void _init_f(dt_mipmap_buffer_t *mipmap_buf, if(!buf.buf) { - fprintf(stderr,"load_status = %d\n",(int)image->load_status); + dt_print(DT_DEBUG_ALWAYS, "[mimpmap _init_f] for ID=%d load_status=%d",image->id, (int)image->load_status); if(image->load_status == DT_IMAGEIO_FILE_NOT_FOUND) dt_control_log(_("image `%s' is not available!"), image->filename); else if(image->load_status == DT_IMAGEIO_LOAD_FAILED || image->load_status == DT_IMAGEIO_IOERROR || @@ -1345,35 +1345,35 @@ static void _init_f(dt_mipmap_buffer_t *mipmap_buf, if(image->buf_dsc.filters != 9u && image->buf_dsc.datatype == TYPE_FLOAT) { dt_print_pipe(DT_DEBUG_PIPE, - "mipmap mosaic_half_size_f", NULL, NULL, DT_DEVICE_CPU, &roi_in, &roi_out); + "mipmap mosaic_half_size_f", NULL, NULL, DT_DEVICE_NONE, &roi_in, &roi_out); dt_iop_clip_and_zoom_mosaic_half_size_f((float *const)out, (const float *const)buf.buf, &roi_out, &roi_in, roi_out.width, roi_in.width, image->buf_dsc.filters); } else if(image->buf_dsc.filters != 9u && image->buf_dsc.datatype == TYPE_UINT16) { dt_print_pipe(DT_DEBUG_PIPE, - "mipmap mosaic_half_size", NULL, NULL, DT_DEVICE_CPU, &roi_in, &roi_out); + "mipmap mosaic_half_size", NULL, NULL, DT_DEVICE_NONE, &roi_in, &roi_out); dt_iop_clip_and_zoom_mosaic_half_size((uint16_t * const)out, (const uint16_t *)buf.buf, &roi_out, &roi_in, roi_out.width, roi_in.width, image->buf_dsc.filters); } else if(image->buf_dsc.filters == 9u && image->buf_dsc.datatype == TYPE_UINT16) { dt_print_pipe(DT_DEBUG_PIPE, - "mipmap mosaic_third_size_xtrans", NULL, NULL, DT_DEVICE_CPU, &roi_in, &roi_out); + "mipmap mosaic_third_size_xtrans", NULL, NULL, DT_DEVICE_NONE, &roi_in, &roi_out); dt_iop_clip_and_zoom_mosaic_third_size_xtrans((uint16_t * const)out, (const uint16_t *)buf.buf, &roi_out, &roi_in, roi_out.width, roi_in.width, image->buf_dsc.xtrans); } else if(image->buf_dsc.filters == 9u && image->buf_dsc.datatype == TYPE_FLOAT) { dt_print_pipe(DT_DEBUG_PIPE, - "mipmap mosaic_third_size_xtrans_f", NULL, NULL, DT_DEVICE_CPU, &roi_in, &roi_out); + "mipmap mosaic_third_size_xtrans_f", NULL, NULL, DT_DEVICE_NONE, &roi_in, &roi_out); dt_iop_clip_and_zoom_mosaic_third_size_xtrans_f(out, (const float *)buf.buf, &roi_out, &roi_in, roi_out.width, roi_in.width, image->buf_dsc.xtrans); } else { dt_print_pipe(DT_DEBUG_ALWAYS, - "mipmap unreachable_codepath", NULL, NULL, DT_DEVICE_CPU, &roi_in, &roi_out); + "mipmap unreachable_codepath", NULL, NULL, DT_DEVICE_NONE, &roi_in, &roi_out); dt_unreachable_codepath(); } } diff --git a/src/develop/pixelpipe_hb.c b/src/develop/pixelpipe_hb.c index cc7e2fc17819..e41d0f922187 100644 --- a/src/develop/pixelpipe_hb.c +++ b/src/develop/pixelpipe_hb.c @@ -1286,8 +1286,7 @@ static gboolean _pixelpipe_process_on_CPU(dt_dev_pixelpipe_t *pipe, dt_iop_colorspace_to_name(cst_from), dt_iop_colorspace_to_name(cst_to), work_profile - ? dt_colorspaces_get_name(work_profile->type, - work_profile->filename) + ? dt_colorspaces_get_name(work_profile->type, work_profile->filename) : "no work profile"); } From 344d74ab759728d55af4e03a8cf8561a96805612 Mon Sep 17 00:00:00 2001 From: Hanno Schwalm Date: Fri, 2 Jan 2026 05:58:41 +0100 Subject: [PATCH 2/2] Less log lines while reporting wb_presets for readability --- src/common/wb_presets.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/common/wb_presets.c b/src/common/wb_presets.c index 77a7e1b5b128..ef5cb4381333 100644 --- a/src/common/wb_presets.c +++ b/src/common/wb_presets.c @@ -140,14 +140,16 @@ void dt_wb_presets_init(const char *alternative) else g_strlcpy(filename, alternative, sizeof(filename)); - dt_print(DT_DEBUG_CONTROL, "[wb_presets] loading wb_presets from `%s'", filename); - if(!g_file_test(filename, G_FILE_TEST_EXISTS)) return; + const gboolean preset_file = g_file_test(filename, G_FILE_TEST_EXISTS); + dt_print(DT_DEBUG_CONTROL, "[wb_presets] loading wb_presets from `%s'%s", + filename, preset_file ? "" : " missing"); + if(!preset_file) return; JsonParser *parser = json_parser_new(); if(!json_parser_load_from_file(parser, filename, &error)) { dt_print(DT_DEBUG_ALWAYS, - "[wb_presets] error: parsing json from `%s' failed\n%s", filename, error->message); + "[wb_presets] error: parsing json from `%s' failed: %s", filename, error->message); g_error_free(error); g_object_unref(parser); return; @@ -158,8 +160,6 @@ void dt_wb_presets_init(const char *alternative) JsonReader *reader = NULL; gboolean valid = TRUE; - dt_print(DT_DEBUG_CONTROL, "[wb_presets] loading noiseprofile file"); - JsonNode *root = json_parser_get_root(parser); if(!root) _ERROR("can't get the root node"); @@ -198,15 +198,13 @@ void dt_wb_presets_init(const char *alternative) g_strdup(json_reader_get_string_value(reader)); json_reader_end_member(reader); - dt_print(DT_DEBUG_CONTROL, "[wb_presets] found maker `%s'", - wb_presets[wb_presets_count].make); // go through all models and check those if(!json_reader_read_member(reader, "models")) _ERROR("missing `models`"); const int n_models = json_reader_count_elements(reader); - dt_print(DT_DEBUG_CONTROL, "[wb_presets] found %d models", n_models); + dt_print(DT_DEBUG_CONTROL, "[wb_presets] found %d models for maker `%s'", n_models, wb_presets[wb_presets_count].make); for(int j = 0; j < n_models; j++) { @@ -223,15 +221,12 @@ void dt_wb_presets_init(const char *alternative) json_reader_end_member(reader); - dt_print(DT_DEBUG_CONTROL, "[wb_presets] found %s", - wb_presets[wb_presets_count].model); - if(!json_reader_read_member(reader, "presets")) _ERROR("missing `presets`"); const int n_presets = json_reader_count_elements(reader); - dt_print(DT_DEBUG_CONTROL, "[wb_presets] found %d presets", - n_presets); + dt_print(DT_DEBUG_CONTROL, "[wb_presets] found %d presets for `%s'", + n_presets, wb_presets[wb_presets_count].model); for(int k = 0; k < n_presets; k++) {