Base maximum output dimensions on limitation of format

This commit is contained in:
Lovell Fuller
2017-05-04 23:20:37 +01:00
parent c8e59f08ec
commit 2f534dc01c
10 changed files with 82 additions and 47 deletions

View File

@@ -97,7 +97,7 @@ const Sharp = function (input, options) {
this.options = {
// input options
sequentialRead: false,
limitInputPixels: maximum.pixels,
limitInputPixels: Math.pow(0x3FFF, 2),
// ICC profiles
iccProfilePath: path.join(__dirname, 'icc') + path.sep,
// resize options
@@ -189,18 +189,6 @@ const Sharp = function (input, options) {
};
util.inherits(Sharp, stream.Duplex);
/**
* Pixel limits.
* @member
* @private
*/
const maximum = {
width: 0x3FFF,
height: 0x3FFF,
pixels: Math.pow(0x3FFF, 2)
};
Sharp.maximum = maximum;
/**
* An EventEmitter that emits a `change` event when a task is either:
* - queued, waiting for _libuv_ to provide a worker thread