mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
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:
committed by
Lovell Fuller
parent
b224874332
commit
1b7c5816fc
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user