Allow WebP encoding effort of 0 (#3261)

This commit is contained in:
AlexanderTheGrey
2022-06-17 02:22:51 -05:00
committed by GitHub
parent b10d8f89ca
commit 4662527a17
2 changed files with 7 additions and 1 deletions

View File

@@ -495,7 +495,7 @@ function webp (options) {
if (is.defined(options.smartSubsample)) {
this._setBooleanOption('webpSmartSubsample', options.smartSubsample);
}
const effort = options.effort || options.reductionEffort;
const effort = is.defined(options.effort) ? options.effort : options.reductionEffort;
if (is.defined(effort)) {
if (is.integer(effort) && is.inRange(effort, 0, 6)) {
this.options.webpEffort = effort;