mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Remove functions previously deprecated in v0.21.0
background, crop, embed, ignoreAspectRatio, max, min, withoutEnlargement
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
const deprecate = require('util').deprecate;
|
||||
|
||||
const color = require('color');
|
||||
const is = require('./is');
|
||||
|
||||
@@ -17,24 +15,6 @@ const colourspace = {
|
||||
srgb: 'srgb'
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @private
|
||||
*/
|
||||
function background (rgba) {
|
||||
const colour = color(rgba);
|
||||
const background = [
|
||||
colour.red(),
|
||||
colour.green(),
|
||||
colour.blue(),
|
||||
Math.round(colour.alpha() * 255)
|
||||
];
|
||||
this.options.resizeBackground = background;
|
||||
this.options.extendBackground = background;
|
||||
this.options.flattenBackground = background.slice(0, 3);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tint the image using the provided chroma while preserving the image luminance.
|
||||
* An alpha channel may be present and will be unchanged by the operation.
|
||||
@@ -136,6 +116,4 @@ module.exports = function (Sharp) {
|
||||
// Class attributes
|
||||
Sharp.colourspace = colourspace;
|
||||
Sharp.colorspace = colourspace;
|
||||
// Deprecated
|
||||
Sharp.prototype.background = deprecate(background, 'background(background) is deprecated, use resize({ background }), extend({ background }) or flatten({ background }) instead');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user