Skip to content

Commit 7ff8242

Browse files
committed
2.0 (beta)
1 parent bf7ead3 commit 7ff8242

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,10 @@ applySmartCrop(src, 'flower-square.jpg', 128, 128);
4848

4949
## Face Detection Example
5050
Check out [smartcrop-cli](https://github.com/jwagner/smartcrop-cli/) for a more advanced [example](https://github.com/jwagner/smartcrop-cli/blob/master/smartcrop-cli.js#L100) of how to use smartcrop from node including face detection with opencv.
51+
52+
53+
## Changelog
54+
55+
### 2.0 (beta)
56+
57+
It's faster.

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ var iop = {
3636
});
3737
},
3838
getData: function(image) {
39+
var options = {kernel: sharp.kernel.cubic, interpolator: sharp.interpolator.bilinear};
3940
return image._sharp
40-
.resize(image.width, image.height)
41+
.resize(image.width, image.height, options)
4142
.raw()
4243
.toBuffer()
4344
.then(function(data) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "smartcrop-sharp",
3-
"version": "1.0.5",
3+
"version": "2.0.0",
44
"description": "smartcrop adapter for sharp",
55
"main": "index.js",
66
"scripts": {
@@ -10,7 +10,7 @@
1010
"license": "MIT",
1111
"dependencies": {
1212
"sharp": "^0.16.0",
13-
"smartcrop": "^1.1.1"
13+
"smartcrop": "^2.0.1"
1414
},
1515
"devDependencies": {
1616
"chai": "^3.5.0",

0 commit comments

Comments
 (0)