Add default background metadata for PNG and GIF images

This commit is contained in:
Lovell Fuller
2021-07-19 14:55:22 +01:00
parent 719c2db8da
commit 3f08f6a359
6 changed files with 22 additions and 1 deletions

View File

@@ -256,6 +256,7 @@ describe('Image metadata', function () {
assert.strictEqual('undefined', typeof metadata.orientation);
assert.strictEqual('undefined', typeof metadata.exif);
assert.strictEqual('undefined', typeof metadata.icc);
assert.deepStrictEqual(metadata.background, { r: 138, g: 148, b: 102 });
done();
});
});
@@ -285,7 +286,7 @@ describe('Image metadata', function () {
.then(({
format, width, height, space, channels, depth,
isProgressive, pages, pageHeight, loop, delay,
hasProfile, hasAlpha
background, hasProfile, hasAlpha
}) => {
assert.strictEqual(format, 'gif');
assert.strictEqual(width, 80);
@@ -298,6 +299,7 @@ describe('Image metadata', function () {
assert.strictEqual(pageHeight, 80);
assert.strictEqual(loop, 0);
assert.deepStrictEqual(delay, Array(30).fill(30));
assert.deepStrictEqual(background, { r: 0, g: 0, b: 0 });
assert.strictEqual(hasProfile, false);
assert.strictEqual(hasAlpha, true);
})