avoid segfault with unknown interpolator

This commit is contained in:
Bernhard K. Weisshuhn
2015-04-19 23:10:29 +02:00
parent 6fc62d39c9
commit 8ac33aad69
3 changed files with 21 additions and 0 deletions

View File

@@ -93,4 +93,16 @@ describe('Interpolation', function() {
});
});
it('unknown interpolator throws', function(done) {
sharp(fixtures.inputJpg)
.resize(320, 240)
.interpolateWith('nonexistant')
.toBuffer()
.catch(function (e) {
assert(
e.toString().match(/VipsInterpolate: class "nonexistant" not found/)
);
})
.finally(done);
});
});