From ae968142eea469115497faf6465346b3e1c115c9 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Sun, 12 Apr 2015 14:23:36 +0100 Subject: [PATCH] Soften limitInputPixels upper limit #146 Default limit of 14-bit dimensions remains --- index.js | 2 +- test/unit/io.js | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/index.js b/index.js index cf875feb..52def2d0 100755 --- a/index.js +++ b/index.js @@ -442,7 +442,7 @@ Sharp.prototype.resize = function(width, height) { Assumes the image dimensions contained in the file header can be trusted */ Sharp.prototype.limitInputPixels = function(limit) { - if (typeof limit === 'number' && !Number.isNaN(limit) && limit % 1 === 0 && limit > 0 && limit <= maximum.pixels) { + if (typeof limit === 'number' && !Number.isNaN(limit) && limit % 1 === 0 && limit > 0) { this.options.limitInputPixels = limit; } else { throw new Error('Invalid pixel limit (1 to ' + maximum.pixels + ') ' + limit); diff --git a/test/unit/io.js b/test/unit/io.js index 70dd2b6c..71ccbf3e 100755 --- a/test/unit/io.js +++ b/test/unit/io.js @@ -665,16 +665,6 @@ describe('Input/output', function() { done(); }); - it('Invalid fails - huge', function(done) { - var isValid = false; - try { - sharp().limitInputPixels(Math.pow(0x3FFF, 2) + 1); - isValid = true; - } catch (e) {} - assert(!isValid); - done(); - }); - it('Invalid fails - string', function(done) { var isValid = false; try {