mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 15:25:07 +01:00
Switch to libvips' resize, make fastShrinkOnLoad optional (#977)
This commit is contained in:
committed by
Lovell Fuller
parent
ebc2a741f6
commit
d0f66c3734
@@ -149,6 +149,7 @@ const Sharp = function (input, options) {
|
||||
kernel: 'lanczos3',
|
||||
interpolator: 'bicubic',
|
||||
centreSampling: false,
|
||||
fastShrinkOnLoad: true,
|
||||
// operations
|
||||
background: [0, 0, 0, 255],
|
||||
flatten: false,
|
||||
|
||||
@@ -142,6 +142,11 @@ function resize (width, height, options) {
|
||||
if (is.defined(options.centreSampling)) {
|
||||
this._setBooleanOption('centreSampling', options.centreSampling);
|
||||
}
|
||||
|
||||
// Shrink on load
|
||||
if (is.defined(options.fastShrinkOnLoad)) {
|
||||
this._setBooleanOption('fastShrinkOnLoad', options.fastShrinkOnLoad);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user