From 209cc16e0dbb2fad7f3e12e0c836c3c4bd1b6a5b Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Mon, 18 Mar 2019 21:21:56 +0100 Subject: [PATCH 1/4] Update histmatching.cc Allow even smaller thumbs for histogram matching. Tested on Phase One 65+ files. Works fine. --- rtengine/histmatching.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/histmatching.cc b/rtengine/histmatching.cc index b83cc0562..3d1eb1657 100644 --- a/rtengine/histmatching.cc +++ b/rtengine/histmatching.cc @@ -289,7 +289,7 @@ void RawImageSource::getAutoMatchedToneCurve(const ColorManagementParams &cp, st histMatchingCache = outCurve; *histMatchingParams = cp; return; - } else if (w * 25 < fw) { + } else if (w * 32 < fw) { if (settings->verbose) { std::cout << "histogram matching: the embedded thumbnail is too small: " << w << "x" << h << std::endl; } From 757af312d2828928d9b38d64f27f047f156b8c99 Mon Sep 17 00:00:00 2001 From: Hombre Date: Tue, 19 Mar 2019 02:02:12 +0100 Subject: [PATCH 2/4] Suppress 'rtwindow.h' from main-cli.cc --- rtgui/main-cli.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rtgui/main-cli.cc b/rtgui/main-cli.cc index ddd42eb6a..cbea1d477 100644 --- a/rtgui/main-cli.cc +++ b/rtgui/main-cli.cc @@ -28,15 +28,17 @@ #include #include #include -#include "rtwindow.h" #include #include #include +#include "../rtengine/procparams.h" +#include "../rtengine/profilestore.h" #include "options.h" #include "soundman.h" #include "rtimage.h" #include "version.h" #include "extprog.h" +#include "pathutils.h" #ifndef WIN32 #include @@ -44,6 +46,8 @@ #include #include #else +#include +#include #include #include "conio.h" #endif From d4d535720db237bd26069719efee51faac3ed39d Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 19 Mar 2019 15:09:18 +0100 Subject: [PATCH 3/4] Don't apply histogram matching when thumb has less than 19200 pixels --- rtengine/histmatching.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rtengine/histmatching.cc b/rtengine/histmatching.cc index 3d1eb1657..48969368f 100644 --- a/rtengine/histmatching.cc +++ b/rtengine/histmatching.cc @@ -289,7 +289,10 @@ void RawImageSource::getAutoMatchedToneCurve(const ColorManagementParams &cp, st histMatchingCache = outCurve; *histMatchingParams = cp; return; - } else if (w * 32 < fw) { + } else if (w * 32 < fw || w * h < 19200) { + // Some cameras have extremely small thumbs, for example Canon PowerShot A3100 IS has 128x96 thumbs. + // For them we skip histogram matching. + // With 160x120 thumbs from RICOH GR DIGITAL 2 it works fine, so we use 19200 as limit. if (settings->verbose) { std::cout << "histogram matching: the embedded thumbnail is too small: " << w << "x" << h << std::endl; } From 28b785682a308447f512536a4fc6cf7da93f4ef2 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Tue, 19 Mar 2019 17:43:42 +0100 Subject: [PATCH 4/4] Allow histogram matching for YI M1 Camera (160x120 thumbs) --- rtengine/histmatching.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/histmatching.cc b/rtengine/histmatching.cc index 48969368f..f91086285 100644 --- a/rtengine/histmatching.cc +++ b/rtengine/histmatching.cc @@ -289,7 +289,7 @@ void RawImageSource::getAutoMatchedToneCurve(const ColorManagementParams &cp, st histMatchingCache = outCurve; *histMatchingParams = cp; return; - } else if (w * 32 < fw || w * h < 19200) { + } else if (w * 33 < fw || w * h < 19200) { // Some cameras have extremely small thumbs, for example Canon PowerShot A3100 IS has 128x96 thumbs. // For them we skip histogram matching. // With 160x120 thumbs from RICOH GR DIGITAL 2 it works fine, so we use 19200 as limit.