Docs: add avif and heif examples

This commit is contained in:
Lovell Fuller
2022-09-01 09:57:50 +01:00
parent 0fe857c5ac
commit 4b38f56d02
2 changed files with 37 additions and 4 deletions

View File

@@ -825,6 +825,16 @@ function tiff (options) {
*
* AVIF image sequences are not supported.
*
* @example
* const data = await sharp(input)
* .avif({ effort: 2 })
* .toBuffer();
*
* @example
* const data = await sharp(input)
* .avif({ lossless: true })
* .toBuffer();
*
* @since 0.27.0
*
* @param {Object} [options] - output options
@@ -842,9 +852,14 @@ function avif (options) {
/**
* Use these HEIF options for output image.
*
* Support for patent-encumbered HEIC images requires the use of a
* Support for patent-encumbered HEIC images using `hevc` compression requires the use of a
* globally-installed libvips compiled with support for libheif, libde265 and x265.
*
* @example
* const data = await sharp(input)
* .heif({ compression: 'hevc' })
* .toBuffer();
*
* @since 0.23.0
*
* @param {Object} [options] - output options