From 4168c469642b7abccb11dab113f7a90d63d08428 Mon Sep 17 00:00:00 2001 From: Mirco Miranda Date: Sun, 15 Sep 2024 10:31:40 +0000 Subject: [PATCH] RAW: Fixed unnecessary image unpack Backport of MR !254 (According to the libraw documentation, the sizes are available directly after open_datastream.) One benefit is that it doubles the speed of preview creation in Dolphin. --- src/imageformats/raw.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/imageformats/raw.cpp b/src/imageformats/raw.cpp index 3b40d6b..da1c4f9 100644 --- a/src/imageformats/raw.cpp +++ b/src/imageformats/raw.cpp @@ -807,12 +807,10 @@ QVariant RAWHandler::option(ImageOption option) const rawProcessor->imgdata.rawparams.shot_select = currentImageNumber(); #endif if (rawProcessor->open_datastream(&stream) == LIBRAW_SUCCESS) { - if (rawProcessor->unpack() == LIBRAW_SUCCESS) { - auto w = libraw_get_iwidth(&rawProcessor->imgdata); - auto h = libraw_get_iheight(&rawProcessor->imgdata); - // flip & 4: taken from LibRaw code - v = (rawProcessor->imgdata.sizes.flip & 4) ? QSize(h, w) : QSize(w, h); - } + auto w = libraw_get_iwidth(&rawProcessor->imgdata); + auto h = libraw_get_iheight(&rawProcessor->imgdata); + // flip & 4: taken from LibRaw code + v = (rawProcessor->imgdata.sizes.flip & 4) ? QSize(h, w) : QSize(w, h); } d->rollbackTransaction(); }