Add a unit test for extract area out of bounds (#498)

This commit is contained in:
Matt Hirsch 2016-07-08 15:52:33 -04:00 committed by Lovell Fuller
parent 8dd554b935
commit 673d8278b5

View File

@ -175,5 +175,14 @@ describe('Partial image extraction', function() {
sharp(fixtures.inputJpg).extract({ left: 10, top: 10, width: 10, height: null });
});
});
it('Bad image area', function(done) {
sharp(fixtures.inputJpg)
.extract({ left: 3000, top: 10, width: 10, height: 10 })
.toBuffer(function(err) {
assert(err instanceof Error);
done();
});
});
});
});