mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Release v0.16.1
This commit is contained in:
@@ -519,6 +519,36 @@ async.series({
|
||||
}
|
||||
});
|
||||
}
|
||||
}).add('sharp-crop-entropy', {
|
||||
defer: true,
|
||||
fn: function(deferred) {
|
||||
sharp(inputJpgBuffer)
|
||||
.resize(width, height)
|
||||
.crop(sharp.strategy.entropy)
|
||||
.toBuffer(function(err, buffer) {
|
||||
if (err) {
|
||||
throw err;
|
||||
} else {
|
||||
assert.notStrictEqual(null, buffer);
|
||||
deferred.resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
}).add('sharp-crop-attention', {
|
||||
defer: true,
|
||||
fn: function(deferred) {
|
||||
sharp(inputJpgBuffer)
|
||||
.resize(width, height)
|
||||
.crop(sharp.strategy.attention)
|
||||
.toBuffer(function(err, buffer) {
|
||||
if (err) {
|
||||
throw err;
|
||||
} else {
|
||||
assert.notStrictEqual(null, buffer);
|
||||
deferred.resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
}).on('cycle', function(event) {
|
||||
console.log('operations ' + String(event.target));
|
||||
}).on('complete', function() {
|
||||
|
||||
Reference in New Issue
Block a user