Ensure limitInputPixels uses uint64 (#3349)

This commit is contained in:
Marcos Casagrande
2022-09-06 10:05:51 +02:00
committed by GitHub
parent f7b29d7b59
commit eee0dd36d9
4 changed files with 14 additions and 1 deletions

View File

@@ -745,6 +745,17 @@ describe('Input/output', function () {
})
);
it('Enabling default limit works and fails for an image with resolution higher than uint32 limit', () =>
sharp(fixtures.inputPngUint32Limit, { limitInputPixels: true })
.toBuffer()
.then(() => {
assert.fail('Expected to fail');
})
.catch(err => {
assert.strictEqual(err.message, 'Input image exceeds pixel limit');
})
);
it('Smaller than input fails', () =>
sharp(fixtures.inputJpg)
.metadata()