mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 15:25:07 +01:00
Remove previously deprecated limitInputPixels, sequentialRead
This commit is contained in:
32
lib/input.js
32
lib/input.js
@@ -1,6 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
const util = require('util');
|
||||
const color = require('color');
|
||||
const is = require('./is');
|
||||
const sharp = require('../build/Release/sharp.node');
|
||||
@@ -331,32 +330,6 @@ function stats (callback) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
const limitInputPixels = util.deprecate(function limitInputPixels (limit) {
|
||||
// if we pass in false we represent the integer as 0 to disable
|
||||
if (limit === false) {
|
||||
limit = 0;
|
||||
} else if (limit === true) {
|
||||
limit = Math.pow(0x3FFF, 2);
|
||||
}
|
||||
if (is.integer(limit) && limit >= 0) {
|
||||
this.options.input.limitInputPixels = limit;
|
||||
} else {
|
||||
throw is.invalidParameterError('limitInputPixels', 'integer', limit);
|
||||
}
|
||||
return this;
|
||||
}, 'limitInputPixels is deprecated, use sharp(input, { limitInputPixels: false }) instead');
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
const sequentialRead = util.deprecate(function sequentialRead (sequentialRead) {
|
||||
this.options.input.sequentialRead = is.bool(sequentialRead) ? sequentialRead : true;
|
||||
return this;
|
||||
}, 'sequentialRead is deprecated, use sharp(input, { sequentialRead: true }) instead');
|
||||
|
||||
/**
|
||||
* Decorate the Sharp prototype with input-related functions.
|
||||
* @private
|
||||
@@ -370,9 +343,6 @@ module.exports = function (Sharp) {
|
||||
_isStreamInput,
|
||||
// Public
|
||||
metadata,
|
||||
stats,
|
||||
// Deprecated
|
||||
limitInputPixels,
|
||||
sequentialRead
|
||||
stats
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user