We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ced4c6 commit f3627eaCopy full SHA for f3627ea
smartcrop.js
@@ -247,9 +247,10 @@ SmartCrop.prototype = {
247
for(var x = 0; x < output.width; x++) {
248
var p = yoffset+x*4,
249
importance = this.importance(crop, x*downSample, ydownSample);
250
- score.skin += od[p]/255*(od[p+1]/255+options.skinBias)*importance;
251
- score.detail += od[p+1]/255*importance;
252
- score.saturation += od[p+2]/255*(od[p+1]/255*1.0+options.saturationBias)*importance;
+ var g = od[p+1]/255;
+ score.skin += od[p]/255*(g+options.skinBias)*importance;
+ score.detail += g*importance;
253
+ score.saturation += od[p+2]/255*(g+options.saturationBias)*importance;
254
//if(Number.isNaN(score.detail)) debugger;
255
//if(Number.isNaN(score.saturation)) debugger;
256
//if(Number.isNaN(score.skin)) debugger;
0 commit comments