Tests: reduce CPU cost of RGBA linear test, ~2s faster

This commit is contained in:
Lovell Fuller
2023-03-21 12:42:50 +00:00
parent cd419a261b
commit f8a430bdd3
4 changed files with 6 additions and 3 deletions

View File

@@ -43,8 +43,9 @@ describe('Linear adjustment', function () {
it('applies linear levels adjustment w alpha ch', function (done) {
sharp(fixtures.inputPngOverlayLayer1)
.resize(240)
.linear(a, b)
.toBuffer(function (err, data, info) {
.toBuffer(function (err, data) {
if (err) throw err;
fixtures.assertSimilar(fixtures.expected('alpha-layer-1-fill-linear.png'), data, done);
});
@@ -52,8 +53,9 @@ describe('Linear adjustment', function () {
it('applies slope level adjustment w alpha ch', function (done) {
sharp(fixtures.inputPngOverlayLayer1)
.resize(240)
.linear(a)
.toBuffer(function (err, data, info) {
.toBuffer(function (err, data) {
if (err) throw err;
fixtures.assertSimilar(fixtures.expected('alpha-layer-1-fill-slope.png'), data, done);
});
@@ -61,8 +63,9 @@ describe('Linear adjustment', function () {
it('applies offset level adjustment w alpha ch', function (done) {
sharp(fixtures.inputPngOverlayLayer1)
.resize(240)
.linear(null, b)
.toBuffer(function (err, data, info) {
.toBuffer(function (err, data) {
if (err) throw err;
fixtures.assertSimilar(fixtures.expected('alpha-layer-1-fill-offset.png'), data, done);
});