mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Limit HEIF output dimensions to 16384x16384
This is a slightly breaking change to sync with the behaviour of a forthcoming libvips patch release. It also matches the libavif limit. Having an arbitrary limit is safer than no limit.
This commit is contained in:
@@ -130,4 +130,18 @@ describe('AVIF', () => {
|
||||
width: 32
|
||||
});
|
||||
});
|
||||
|
||||
it('Invalid width - too large', async () =>
|
||||
assert.rejects(
|
||||
() => sharp({ create: { width: 16385, height: 16, channels: 3, background: 'red' } }).avif().toBuffer(),
|
||||
/Processed image is too large for the HEIF format/
|
||||
)
|
||||
);
|
||||
|
||||
it('Invalid height - too large', async () =>
|
||||
assert.rejects(
|
||||
() => sharp({ create: { width: 16, height: 16385, channels: 3, background: 'red' } }).avif().toBuffer(),
|
||||
/Processed image is too large for the HEIF format/
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user