Skip to content

Commit 5e9bd9e

Browse files
committed
cleaning up some gunk
1 parent 2ca07e4 commit 5e9bd9e

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed

smartcrop.js

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ SmartCrop.crop = function(image, options, callback){
8888
// -> don't pick crops that need upscaling
8989
options.minScale = min(options.maxScale || SmartCrop.DEFAULTS.maxScale, max(1/scale, (options.minScale||SmartCrop.DEFAULTS.minScale)));
9090
}
91-
//console.log(options);
9291
var smartCrop = new SmartCrop(options);
9392
if(options.width && options.height) {
9493
if(options.prescale !== false){
@@ -163,8 +162,6 @@ SmartCrop.prototype = {
163162
else {
164163
od[p] = 0;
165164
}
166-
//od[p] = lightness;
167-
//od[p+2] = lightness;
168165
}
169166
}
170167
},
@@ -185,7 +182,6 @@ SmartCrop.prototype = {
185182
else {
186183
od[p+2] = 0;
187184
}
188-
//od[p+2] = saturation > options.saturation ? 255 : saturation*127;
189185
}
190186
}
191187
},
@@ -233,45 +229,12 @@ SmartCrop.prototype = {
233229
score.skin += od[p]/255*(detail+options.skinBias)*importance;
234230
score.detail += detail*importance;
235231
score.saturation += od[p+2]/255*(detail+options.saturationBias)*importance;
236-
//if(Number.isNaN(score.detail)) debugger;
237-
//if(Number.isNaN(score.saturation)) debugger;
238-
//if(Number.isNaN(score.skin)) debugger;
239-
//if(Number.isNaN(score.total)) debugger;
240232
}
241233

242234
}
243235
score.total = (score.detail*options.detailWeight + score.skin*options.skinWeight + score.saturation*options.saturationWeight)/crop.width/crop.height;
244-
//console.log(score);
245236
return score;
246237
},
247-
//_score: function(output, crop){
248-
//var score = {
249-
//detail: 0,
250-
//saturation: 0,
251-
//skin: 0,
252-
//total: 0
253-
//},
254-
//options = this.options,
255-
//downSample = options.scoreDownSample,
256-
//invDownSample = 1/downSample;
257-
//for(var y = crop.y; y < crop.y+crop.height; y+=downSample) {
258-
//for(var x = crop.x; x < crop.x+crop.width; x+=downSample) {
259-
//var p = (~~(y*invDownSample)*output.width+~~(x*invDownSample))*4;
260-
//score.detail += output.data[p+1]/255*this.importance((x-crop.x)/crop.width, (y-crop.y)/crop.height);
261-
//score.saturation += output.data[p+2]/255*this.importance((x-crop.x)/crop.width, (y-crop.y)/crop.height);
262-
//score.skin += output.data[p]/255*(output.data[p+1]/255+options.skinBias)*this.importance((x-crop.x)/crop.width, (y-crop.y)/crop.height);
263-
////if(Number.isNaN(score.detail)) debugger;
264-
////if(Number.isNaN(score.saturation)) debugger;
265-
////if(Number.isNaN(score.skin)) debugger;
266-
////if(Number.isNaN(score.total)) debugger;
267-
//}
268-
269-
//}
270-
//score.total = (score.detail*options.detailWeight + score.skin*options.skinWeight + score.saturation*options.saturationWeight)/crop.width/crop.height;
271-
////console.log(score);
272-
//return score;
273-
//},
274-
275238
importance: function(crop, x, y){
276239
var options = this.options;
277240

@@ -333,7 +296,6 @@ SmartCrop.prototype = {
333296

334297
}
335298

336-
//console.log(crops);
337299
result.crops = crops;
338300
result.topCrop = topCrop;
339301

@@ -352,8 +314,6 @@ SmartCrop.prototype = {
352314
if(importance < 0) {
353315
output.data[p] += importance*-64;
354316
}
355-
//output.data[p+1] = this.skinColor(input.data[p], input.data[p+1], input.data[p+2], options)*255;
356-
//output.data[p+2] = 0;
357317
output.data[p+3] = 255;
358318
}
359319
}

0 commit comments

Comments
 (0)