diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index eee4f34c0..4786000bb 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -5497,7 +5497,8 @@ nf: order = 0x4949; for (c=i=2; (ushort) c != 0xbbbb && i < len; i++) c = c << 8 | fgetc(ifp); while ((i+=4) < len-5) - if (get4() == 257 && (i=len) && (c = (get4(),fgetc(ifp))) < 3) + if (get4() == 257 && (i=len) && (c = (get4(),fgetc(ifp))) < 3 && strcmp(make,"Canon")) + // don't use this tag for Canon cameras as it's known to give wrong orientation some times flip = "065"[c]-'0'; } if (tag == 0x10 && type == 4) diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 6b100f021..6004a676a 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -346,11 +346,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, Crop* cropCall) imgsrc->preprocess(rp, params.lensProf, params.coarse); imgsrc->getRAWHistogram(histRedRaw, histGreenRaw, histBlueRaw); - if (highDetailNeeded) { - highDetailPreprocessComputed = true; - } else { - highDetailPreprocessComputed = false; - } + highDetailPreprocessComputed = highDetailNeeded; } /* @@ -416,21 +412,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, Crop* cropCall) } } - - // Updating toneCurve.hrenabled if necessary - // It has to be done there, because the next 'if' statement will use the value computed here - if (todo & M_AUTOEXP) { - if (params.toneCurve.autoexp) {// this enabled HLRecovery - if (ToneCurveParams::HLReconstructionNecessary(histRedRaw, histGreenRaw, histBlueRaw) && !params.toneCurve.hrenabled) { - // switching params.toneCurve.hrenabled to true -> shouting in listener's ears! - params.toneCurve.hrenabled = true; - - // forcing INIT to be done, to reconstruct HL again - todo |= M_INIT; - } - } - } - if (todo & (M_INIT | M_LINDENOISE | M_HDR)) { MyMutex::MyLock initLock(minit); // Also used in crop window diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index e499e588b..1162af84f 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -361,22 +361,6 @@ bool ToneCurveParams::operator !=(const ToneCurveParams& other) const return !(*this == other); } -bool ToneCurveParams::HLReconstructionNecessary(const LUTu& histRedRaw, const LUTu& histGreenRaw, const LUTu& histBlueRaw) -{ - if (options.rtSettings.verbose) { - printf("histRedRaw[ 0]=%07d, histGreenRaw[ 0]=%07d, histBlueRaw[ 0]=%07d\nhistRedRaw[255]=%07d, histGreenRaw[255]=%07d, histBlueRaw[255]=%07d\n", - histRedRaw[0], histGreenRaw[0], histBlueRaw[0], histRedRaw[255], histGreenRaw[255], histBlueRaw[255]); - } - - return - histRedRaw[255] > 50 - || histGreenRaw[255] > 50 - || histBlueRaw[255] > 50 - || histRedRaw[0] > 50 - || histGreenRaw[0] > 50 - || histBlueRaw[0] > 50; -} - RetinexParams::RetinexParams() : enabled(false), cdcurve{ diff --git a/rtengine/procparams.h b/rtengine/procparams.h index d3e614510..041a1fe5b 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -291,7 +291,6 @@ struct ToneCurveParams { bool operator ==(const ToneCurveParams& other) const; bool operator !=(const ToneCurveParams& other) const; - static bool HLReconstructionNecessary(const LUTu& histRedRaw, const LUTu& histGreenRaw, const LUTu& histBlueRaw); }; /** diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 8ba0853cc..6e1209d91 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -207,16 +207,6 @@ private: imgsrc->setCurrentFrame(params.raw.bayersensor.imageNum); imgsrc->preprocess(params.raw, params.lensProf, params.coarse, params.dirpyrDenoise.enabled); - if (params.toneCurve.autoexp) {// this enabled HLRecovery - LUTu histRedRaw(256), histGreenRaw(256), histBlueRaw(256); - imgsrc->getRAWHistogram(histRedRaw, histGreenRaw, histBlueRaw); - - if (ToneCurveParams::HLReconstructionNecessary(histRedRaw, histGreenRaw, histBlueRaw) && !params.toneCurve.hrenabled) { - params.toneCurve.hrenabled = true; - // WARNING: Highlight Reconstruction is being forced 'on', should we force a method here too? - } - } - if (pl) { pl->setProgress(0.20); }