Allow full WebP alphaQuality range of 0-100 (#1290)

This commit is contained in:
Sylvain Dumont 2018-07-10 16:58:17 +02:00 committed by Lovell Fuller
parent 7bbc5176a1
commit 8b75ce6786

View File

@ -271,10 +271,10 @@ function webp (options) {
}
}
if (is.object(options) && is.defined(options.alphaQuality)) {
if (is.integer(options.alphaQuality) && is.inRange(options.alphaQuality, 1, 100)) {
if (is.integer(options.alphaQuality) && is.inRange(options.alphaQuality, 0, 100)) {
this.options.webpAlphaQuality = options.alphaQuality;
} else {
throw new Error('Invalid webp alpha quality (integer, 1-100) ' + options.alphaQuality);
throw new Error('Invalid webp alpha quality (integer, 0-100) ' + options.alphaQuality);
}
}
if (is.object(options) && is.defined(options.lossless)) {