diff --git a/docs/api-output.md b/docs/api-output.md index 495437f4..c25aca90 100644 --- a/docs/api-output.md +++ b/docs/api-output.md @@ -341,13 +341,9 @@ await sharp('animated.webp', { animated: true }) ``` ```javascript -// Create 128x128, non-dithered thumbnail of an animated GIF -const { pages } = await sharp('animated.gif').metadata(); -const gif = await sharp('animated.gif', { animated: true }) - .resize({ - width: 128, - height: 128 * pages - }) +// Create a 128x128, cropped, non-dithered, animated thumbnail of an animated GIF +const out = await sharp('in.gif', { animated: true }) + .resize({ width: 128, height: 128 }) .gif({ dither: 0 }) .toBuffer(); ``` diff --git a/lib/output.js b/lib/output.js index 7f041417..cb7e451a 100644 --- a/lib/output.js +++ b/lib/output.js @@ -521,13 +521,9 @@ function webp (options) { * .toFile('animated.gif'); * * @example - * // Create 128x128, non-dithered thumbnail of an animated GIF - * const { pages } = await sharp('animated.gif').metadata(); - * const gif = await sharp('animated.gif', { animated: true }) - * .resize({ - * width: 128, - * height: 128 * pages - * }) + * // Create a 128x128, cropped, non-dithered, animated thumbnail of an animated GIF + * const out = await sharp('in.gif', { animated: true }) + * .resize({ width: 128, height: 128 }) * .gif({ dither: 0 }) * .toBuffer(); *