do not perform histogram matching if the embedded thumbnail is too small

Fixes #4467
This commit is contained in:
Alberto Griggio 2018-03-27 14:41:19 +02:00
parent 95a5f3d662
commit 100da304b8

View File

@ -227,6 +227,13 @@ void RawImageSource::getAutoMatchedToneCurve(const ColorManagementParams &cp, st
histMatchingCache = outCurve;
histMatchingParams = cp;
return;
} else if (w * 10 < fw) {
if (settings->verbose) {
std::cout << "histogram matching: the embedded thumbnail is too small: " << w << "x" << h << std::endl;
}
histMatchingCache = outCurve;
histMatchingParams = cp;
return;
}
skip = LIM(skip * fh / h, 6, 10); // adjust the skip factor -- the larger the thumbnail, the less we should skip to get a good match
source.reset(thumb->quickProcessImage(neutral, fh / skip, TI_Nearest));