mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Ensure AVIF output is always 8-bit #3358
This commit is contained in:
@@ -103,4 +103,28 @@ describe('AVIF', () => {
|
||||
width: 10
|
||||
});
|
||||
});
|
||||
|
||||
it('should cast to uchar', async () => {
|
||||
const data = await sharp(inputJpg)
|
||||
.resize(32)
|
||||
.sharpen()
|
||||
.avif({ effort: 0 })
|
||||
.toBuffer();
|
||||
const { size, ...metadata } = await sharp(data)
|
||||
.metadata();
|
||||
assert.deepStrictEqual(metadata, {
|
||||
channels: 3,
|
||||
compression: 'av1',
|
||||
depth: 'uchar',
|
||||
format: 'heif',
|
||||
hasAlpha: false,
|
||||
hasProfile: false,
|
||||
height: 26,
|
||||
isProgressive: false,
|
||||
pagePrimary: 0,
|
||||
pages: 1,
|
||||
space: 'srgb',
|
||||
width: 32
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user