Standardise WebP effort option name, deprecate reductionEffort

This commit is contained in:
Lovell Fuller
2021-11-24 18:54:30 +00:00
parent 72025051c5
commit 2b1f5cbe07
9 changed files with 68 additions and 59 deletions

View File

@@ -282,7 +282,7 @@ Use these WebP options for output image.
* `options.lossless` **[boolean][7]** use lossless compression mode (optional, default `false`)
* `options.nearLossless` **[boolean][7]** use near_lossless compression mode (optional, default `false`)
* `options.smartSubsample` **[boolean][7]** use high quality chroma subsampling (optional, default `false`)
* `options.reductionEffort` **[number][9]** level of CPU effort to reduce file size, integer 0-6 (optional, default `4`)
* `options.effort` **[number][9]** level of CPU effort to reduce file size, integer 0-6 (optional, default `4`)
* `options.pageHeight` **[number][9]?** page height for animated output
* `options.loop` **[number][9]** number of animation iterations, use 0 for infinite animation (optional, default `0`)
* `options.delay` **[Array][10]<[number][9]>?** list of delays between animation frames (in milliseconds)
@@ -300,7 +300,7 @@ const data = await sharp(input)
```javascript
// Optimise the file size of an animated WebP
const outputWebp = await sharp(inputWebp, { animated: true })
.webp({ reductionEffort: 6 })
.webp({ effort: 6 })
.toBuffer();
```

View File

@@ -10,6 +10,8 @@ Requires libvips v8.12.0
* Reduce minimum Linux ARM64v8 glibc requirement to 2.17.
* Standardise WebP `effort` option name, deprecate `reductionEffort`.
* Expose control over CPU effort for palette-based PNG output.
[#2541](https://github.com/lovell/sharp/issues/2541)

File diff suppressed because one or more lines are too long