mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Tests: ensure AVIF order is read, write, read+write
This commit is contained in:
parent
23a48be315
commit
d9af897595
@ -12,29 +12,6 @@ describe('AVIF', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can passthrough AVIF', async () => {
|
|
||||||
const data = await sharp(inputAvif)
|
|
||||||
.resize(32)
|
|
||||||
.toBuffer();
|
|
||||||
const metadata = await sharp(data)
|
|
||||||
.metadata();
|
|
||||||
const { compression, size, ...metadataWithoutSize } = metadata;
|
|
||||||
assert.deepStrictEqual(metadataWithoutSize, {
|
|
||||||
channels: 3,
|
|
||||||
depth: 'uchar',
|
|
||||||
format: 'heif',
|
|
||||||
hasAlpha: false,
|
|
||||||
hasProfile: false,
|
|
||||||
height: 12,
|
|
||||||
isProgressive: false,
|
|
||||||
pageHeight: 12,
|
|
||||||
pagePrimary: 0,
|
|
||||||
pages: 1,
|
|
||||||
space: 'srgb',
|
|
||||||
width: 32
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('can convert AVIF to JPEG', async () => {
|
it('can convert AVIF to JPEG', async () => {
|
||||||
const data = await sharp(inputAvif)
|
const data = await sharp(inputAvif)
|
||||||
.resize(32)
|
.resize(32)
|
||||||
@ -81,4 +58,27 @@ describe('AVIF', () => {
|
|||||||
width: 32
|
width: 32
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('can passthrough AVIF', async () => {
|
||||||
|
const data = await sharp(inputAvif)
|
||||||
|
.resize(32)
|
||||||
|
.toBuffer();
|
||||||
|
const metadata = await sharp(data)
|
||||||
|
.metadata();
|
||||||
|
const { compression, size, ...metadataWithoutSize } = metadata;
|
||||||
|
assert.deepStrictEqual(metadataWithoutSize, {
|
||||||
|
channels: 3,
|
||||||
|
depth: 'uchar',
|
||||||
|
format: 'heif',
|
||||||
|
hasAlpha: false,
|
||||||
|
hasProfile: false,
|
||||||
|
height: 12,
|
||||||
|
isProgressive: false,
|
||||||
|
pageHeight: 12,
|
||||||
|
pagePrimary: 0,
|
||||||
|
pages: 1,
|
||||||
|
space: 'srgb',
|
||||||
|
width: 32
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user