Ability to disable limitInputPixels #250

Update docs
Added a giant image for testing
Adding myself to contributors
Added tests to verify giant image can be opened
Extend test-win time limit (because of large images)
This commit is contained in:
kentongray
2016-04-04 02:35:11 -05:00
committed by Lovell Fuller
parent b2d7d4c4a9
commit 8c9c070caf
7 changed files with 35 additions and 6 deletions

View File

@@ -876,6 +876,24 @@ describe('Input/output', function() {
});
});
it('Disabling limit works', function(done) {
sharp(fixtures.inputPngLarge)
.limitInputPixels(false)
.toBuffer(function(err) {
assert.strictEqual(true, !err);
done();
});
});
it('Enabling default limit fails works and fails with a large image', function(done) {
sharp(fixtures.inputPngLarge)
.limitInputPixels(true)
.toBuffer(function(err) {
assert.strictEqual(true, !!err);
done();
});
});
it('Smaller than input fails', function(done) {
sharp(fixtures.inputJpg).metadata(function(err, metadata) {
if (err) throw err;