mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Docs: correct gif resize example
This commit is contained in:
parent
96992845ed
commit
92399ee5e2
@ -341,13 +341,9 @@ await sharp('animated.webp', { animated: true })
|
|||||||
```
|
```
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// Create 128x128, non-dithered thumbnail of an animated GIF
|
// Create a 128x128, cropped, non-dithered, animated thumbnail of an animated GIF
|
||||||
const { pages } = await sharp('animated.gif').metadata();
|
const out = await sharp('in.gif', { animated: true })
|
||||||
const gif = await sharp('animated.gif', { animated: true })
|
.resize({ width: 128, height: 128 })
|
||||||
.resize({
|
|
||||||
width: 128,
|
|
||||||
height: 128 * pages
|
|
||||||
})
|
|
||||||
.gif({ dither: 0 })
|
.gif({ dither: 0 })
|
||||||
.toBuffer();
|
.toBuffer();
|
||||||
```
|
```
|
||||||
|
@ -521,13 +521,9 @@ function webp (options) {
|
|||||||
* .toFile('animated.gif');
|
* .toFile('animated.gif');
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Create 128x128, non-dithered thumbnail of an animated GIF
|
* // Create a 128x128, cropped, non-dithered, animated thumbnail of an animated GIF
|
||||||
* const { pages } = await sharp('animated.gif').metadata();
|
* const out = await sharp('in.gif', { animated: true })
|
||||||
* const gif = await sharp('animated.gif', { animated: true })
|
* .resize({ width: 128, height: 128 })
|
||||||
* .resize({
|
|
||||||
* width: 128,
|
|
||||||
* height: 128 * pages
|
|
||||||
* })
|
|
||||||
* .gif({ dither: 0 })
|
* .gif({ dither: 0 })
|
||||||
* .toBuffer();
|
* .toBuffer();
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user