mirror of
https://github.com/lovell/sharp.git
synced 2025-07-10 19:10:14 +02:00
Add test coverage for single value extend operation
This commit is contained in:
parent
6cf0b3240d
commit
50b461024d
BIN
test/fixtures/expected/extend-equal-single.jpg
vendored
Normal file
BIN
test/fixtures/expected/extend-equal-single.jpg
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
@ -6,6 +6,18 @@ const sharp = require('../../');
|
|||||||
const fixtures = require('../fixtures');
|
const fixtures = require('../fixtures');
|
||||||
|
|
||||||
describe('Extend', function () {
|
describe('Extend', function () {
|
||||||
|
it('extend all sides equally via a single value', function (done) {
|
||||||
|
sharp(fixtures.inputJpg)
|
||||||
|
.resize(120)
|
||||||
|
.extend(10)
|
||||||
|
.toBuffer(function (err, data, info) {
|
||||||
|
if (err) throw err;
|
||||||
|
assert.strictEqual(140, info.width);
|
||||||
|
assert.strictEqual(118, info.height);
|
||||||
|
fixtures.assertSimilar(fixtures.expected('extend-equal-single.jpg'), data, done);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('extend all sides equally with RGB', function (done) {
|
it('extend all sides equally with RGB', function (done) {
|
||||||
sharp(fixtures.inputJpg)
|
sharp(fixtures.inputJpg)
|
||||||
.resize(120)
|
.resize(120)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user