mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Better validation and test coverage for background colours
This commit is contained in:
@@ -239,7 +239,7 @@ function resize (width, height, options) {
|
||||
}
|
||||
// Background
|
||||
if (is.defined(options.background)) {
|
||||
this._setColourOption('resizeBackground', options.background);
|
||||
this._setBackgroundColourOption('resizeBackground', options.background);
|
||||
}
|
||||
// Kernel
|
||||
if (is.defined(options.kernel)) {
|
||||
@@ -305,7 +305,7 @@ function extend (extend) {
|
||||
this.options.extendBottom = extend.bottom;
|
||||
this.options.extendLeft = extend.left;
|
||||
this.options.extendRight = extend.right;
|
||||
this._setColourOption('extendBackground', extend.background);
|
||||
this._setBackgroundColourOption('extendBackground', extend.background);
|
||||
} else {
|
||||
throw is.invalidParameterError('extend', 'integer or object', extend);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user