Skip to content

Commit 85f9a9e

Browse files
jenshannoschwalmTurboGit
authored andcommitted
Fix capture threshold default reading
1 parent 669c18b commit 85f9a9e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/iop/demosaic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ int legacy_params(dt_iop_module_t *self,
383383
dt_iop_demosaic_params_v5_t *n = malloc(sizeof(dt_iop_demosaic_params_v5_t));
384384
memcpy(n, o, sizeof *o);
385385
n->cs_radius = 0.0f;
386-
n->cs_thrs = _get_variance_threshold(self);
386+
n->cs_thrs = 0.4f;
387387
n->cs_boost = 0.0f;
388388
n->cs_iter = 0;
389389
n->cs_center = 0.0f;

src/iop/demosaicing/capture.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ static float _get_variance_threshold(const dt_iop_module_t *self)
5656
5757
*/
5858
float threshold = 0.4f;
59-
const dt_image_t *img = &self->dev->image_storage;
60-
if(img->raw_white_point > 4096) threshold -= 0.07f;
61-
if(img->exif_iso < 400) threshold -= 0.03f;
62-
if(img->exif_iso <= 100) threshold -= 0.03f;
59+
const dt_image_t *img = self->dev ? &self->dev->image_storage : NULL;
60+
if(img && img->raw_white_point > 4096) threshold -= 0.07f;
61+
if(img && img->exif_iso < 400) threshold -= 0.03f;
62+
if(img && img->exif_iso <= 100) threshold -= 0.03f;
6363
return threshold;
6464
}
6565

0 commit comments

Comments
 (0)