mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Improve error message for SVG render above limit #3167
This commit is contained in:
@@ -136,6 +136,20 @@ describe('SVG input', function () {
|
||||
assert.strictEqual(info.channels, 4);
|
||||
});
|
||||
|
||||
it('Fails to render SVG larger than 32767x32767', () =>
|
||||
assert.rejects(
|
||||
() => sharp(Buffer.from('<svg width="32768" height="1" />')).toBuffer(),
|
||||
/Input SVG image exceeds 32767x32767 pixel limit/
|
||||
)
|
||||
);
|
||||
|
||||
it('Fails to render scaled SVG larger than 32767x32767', () =>
|
||||
assert.rejects(
|
||||
() => sharp(Buffer.from('<svg width="32767" height="1" />')).resize(32768).toBuffer(),
|
||||
/Input SVG image will exceed 32767x32767 pixel limit when scaled/
|
||||
)
|
||||
);
|
||||
|
||||
it('Detects SVG passed as a string', () =>
|
||||
assert.rejects(
|
||||
() => sharp('<svg></svg>').toBuffer(),
|
||||
|
||||
Reference in New Issue
Block a user