Speed up slow pixel limit tests (#404)

This replaces the single color 20000x14000 PNG with a 20000x14000
Grayscale JPG. On a Broadwell Core i7 @ 3.1 GHz this speeds up the
"Disabling limit works" test from ~6.2s to ~0.15s because it can use
jpeg resize-on-load optimizations.

This should fix occasional timeouts on Travis CI.
This commit is contained in:
Felix Bünemann
2016-04-08 23:21:28 +02:00
committed by Lovell Fuller
parent b224874332
commit 1b7c5816fc
4 changed files with 4 additions and 4 deletions

View File

@@ -877,7 +877,7 @@ describe('Input/output', function() {
});
it('Disabling limit works', function(done) {
sharp(fixtures.inputPngLarge)
sharp(fixtures.inputJpgLarge)
.limitInputPixels(false)
.resize(2)
.toBuffer(function(err) {
@@ -886,8 +886,8 @@ describe('Input/output', function() {
});
});
it('Enabling default limit fails works and fails with a large image', function(done) {
sharp(fixtures.inputPngLarge)
it('Enabling default limit works and fails with a large image', function(done) {
sharp(fixtures.inputJpgLarge)
.limitInputPixels(true)
.toBuffer(function(err) {
assert.strictEqual(true, !!err);