From d4d535720db237bd26069719efee51faac3ed39d Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 19 Mar 2019 15:09:18 +0100 Subject: [PATCH] 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; }