mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Ensure invalid resize width/height as options throw #1817
This commit is contained in:
@@ -87,6 +87,18 @@ describe('Resize dimensions', function () {
|
||||
}, /Expected positive integer for height but received 1.5 of type number/);
|
||||
});
|
||||
|
||||
it('Invalid width - via options', () => {
|
||||
assert.throws(() => {
|
||||
sharp().resize({ width: 1.5, height: 240 });
|
||||
}, /Expected positive integer for width but received 1.5 of type number/);
|
||||
});
|
||||
|
||||
it('Invalid height - via options', () => {
|
||||
assert.throws(() => {
|
||||
sharp().resize({ width: 320, height: 1.5 });
|
||||
}, /Expected positive integer for height but received 1.5 of type number/);
|
||||
});
|
||||
|
||||
it('Invalid width - too large', function (done) {
|
||||
sharp(fixtures.inputJpg)
|
||||
.resize(0x4000, 1)
|
||||
|
||||
Reference in New Issue
Block a user