mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Ensure modulate can co-exist with other colour ops #1958
This commit is contained in:
BIN
test/fixtures/expected/modulate-linear.jpg
vendored
Normal file
BIN
test/fixtures/expected/modulate-linear.jpg
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
@@ -122,4 +122,21 @@ describe('Modulate', function () {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should be able to use linear and modulate together', function () {
|
||||
const base = 'modulate-linear.jpg';
|
||||
const actual = fixtures.path('output.' + base);
|
||||
const expected = fixtures.expected(base);
|
||||
|
||||
const contrast = 1.5;
|
||||
const brightness = 0.5;
|
||||
|
||||
return sharp(fixtures.testPattern)
|
||||
.linear(contrast, -(128 * contrast) + 128)
|
||||
.modulate({ brightness })
|
||||
.toFile(actual)
|
||||
.then(function () {
|
||||
fixtures.assertMaxColourDistance(actual, expected);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user