From 50a5cb96731079fb041e3d4989de849d909beadf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Komar=C4=8Devi=C4=87?= Date: Tue, 30 Jan 2024 16:37:52 +0100 Subject: [PATCH] imageio_rawspeed: workaround for white level magic value --- src/imageio/imageio_rawspeed.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/imageio/imageio_rawspeed.cc b/src/imageio/imageio_rawspeed.cc index c17e877cfc1c..bf6f7fa721a4 100644 --- a/src/imageio/imageio_rawspeed.cc +++ b/src/imageio/imageio_rawspeed.cc @@ -231,12 +231,6 @@ dt_imageio_retval_t dt_imageio_open_rawspeed(dt_image_t *img, img->raw_black_level = CLAMP(roundf(black), 0, UINT16_MAX); } - /* - * FIXME - * if(r->whitePoint == 65536) - * ??? - */ - /* free auto pointers on spot */ d.reset(); storage.reset(); @@ -265,6 +259,8 @@ dt_imageio_retval_t dt_imageio_open_rawspeed(dt_image_t *img, img->flags |= DT_IMAGE_HDR; // we assume that image is normalized before. + // use 1.0f as binary32 for white point magic value. + if(r->whitePoint == 65535) img->raw_white_point = 0x3f800000U; // FIXME: not true for hdrmerge DNG's. for(int k = 0; k < 4; k++) img->buf_dsc.processed_maximum[k] = 1.0f; }