mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Tests: reduce CPU cost of RGBA linear test, ~2s faster
This commit is contained in:
parent
cd419a261b
commit
f8a430bdd3
BIN
test/fixtures/expected/alpha-layer-1-fill-linear.png
vendored
BIN
test/fixtures/expected/alpha-layer-1-fill-linear.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 154 KiB After Width: | Height: | Size: 12 KiB |
BIN
test/fixtures/expected/alpha-layer-1-fill-offset.png
vendored
BIN
test/fixtures/expected/alpha-layer-1-fill-offset.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 9.2 KiB |
BIN
test/fixtures/expected/alpha-layer-1-fill-slope.png
vendored
BIN
test/fixtures/expected/alpha-layer-1-fill-slope.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 179 KiB After Width: | Height: | Size: 13 KiB |
@ -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);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user