Shadows from S/H broken on small JPEG files, Issue 2408
This commit is contained in:
@@ -190,7 +190,8 @@ void Crop::update (int todo) {
|
|||||||
double shradius = params.sh.radius;
|
double shradius = params.sh.radius;
|
||||||
if (!params.sh.hq) shradius *= radius / 1800.0;
|
if (!params.sh.hq) shradius *= radius / 1800.0;
|
||||||
cshmap->update (baseCrop, shradius, parent->ipf.lumimul, params.sh.hq, skip);
|
cshmap->update (baseCrop, shradius, parent->ipf.lumimul, params.sh.hq, skip);
|
||||||
cshmap->forceStat (parent->shmap->max_f, parent->shmap->min_f, parent->shmap->avg);
|
if(parent->shmap->min_f < 65535.f) // don't call forceStat with wrong values
|
||||||
|
cshmap->forceStat (parent->shmap->max_f, parent->shmap->min_f, parent->shmap->avg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// shadows & highlights & tone curve & convert to cielab
|
// shadows & highlights & tone curve & convert to cielab
|
||||||
|
@@ -140,8 +140,8 @@ void SHMap::update (Imagefloat* img, double radius, double lumi[3], bool hq, int
|
|||||||
#ifdef _OPENMP
|
#ifdef _OPENMP
|
||||||
#pragma omp for reduction(+:_avg) nowait
|
#pragma omp for reduction(+:_avg) nowait
|
||||||
#endif
|
#endif
|
||||||
for (int i=32; i<H-32; i++)
|
for (int i=0; i<H; i++)
|
||||||
for (int j=32; j<W-32; j++) {
|
for (int j=0; j<W; j++) {
|
||||||
_val = map[i][j];
|
_val = map[i][j];
|
||||||
if (_val < _min_f)
|
if (_val < _min_f)
|
||||||
_min_f = _val;
|
_min_f = _val;
|
||||||
@@ -159,7 +159,7 @@ void SHMap::update (Imagefloat* img, double radius, double lumi[3], bool hq, int
|
|||||||
max_f = _max_f;
|
max_f = _max_f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_avg /= ((H-64)*(W-64));
|
_avg /= ((H)*(W));
|
||||||
avg = _avg;
|
avg = _avg;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user