From 742d7ee0374c8b001dd4664f562bd467aa79ecef Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 1 Nov 2016 16:46:57 +0100 Subject: [PATCH] Small corrections to set the number of the frame to be extracted from raw file --- rtengine/rawimage.cc | 6 +++++- rtengine/rawimage.h | 7 ------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/rtengine/rawimage.cc b/rtengine/rawimage.cc index 8c09dbc50..b4add328b 100644 --- a/rtengine/rawimage.cc +++ b/rtengine/rawimage.cc @@ -422,10 +422,14 @@ int RawImage::loadRaw (bool loadData, bool closeFile, ProgressListener *plistene raw_image = nullptr; //***************** Read ALL raw file info - setFrameNumber(frameNum); + // set the number of the frame to extract. If the number is larger then number of existing frames - 1, dcraw will handle that correctly + shot_select = frameNum; identify (); + // in case dcraw didn't handle the above mentioned case... + shot_select = std::min(shot_select, std::max(is_raw, 1u) - 1); + if (!is_raw) { fclose(ifp); ifp = nullptr; diff --git a/rtengine/rawimage.h b/rtengine/rawimage.h index 474b9b8ee..2ba434960 100644 --- a/rtengine/rawimage.h +++ b/rtengine/rawimage.h @@ -307,13 +307,6 @@ public: return zero_is_bad == 1 ? true : false; } - void setFrameNumber(unsigned int frameNum) { - // a single raw file can contain more than one frame. - // Variable is_raw holds the number of frames in the raw file - // use setFrameNumber() to set the number of the frame [0; is_raw - 1] to be processed - shot_select = std::min(std::max(is_raw, 1u) - 1, frameNum); - } - public: // dcraw functions void scale_colors()