From 4debc46d0e026e94c8c6581eb0824a4ae8e524bf Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Tue, 22 Dec 2020 11:47:54 +0000 Subject: [PATCH] Docs: add AVIF to supported formats --- README.md | 2 +- docs/api-channel.md | 2 +- docs/api-constructor.md | 12 ++++++------ docs/api-output.md | 4 ++-- docs/index.html | 2 +- docs/search-index.json | 2 +- lib/channel.js | 2 +- lib/constructor.js | 12 ++++++------ lib/output.js | 4 ++-- package.json | 2 +- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 70f0992e..cfca4f8c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The typical use case for this high speed Node.js module is to convert large images in common formats to -smaller, web-friendly JPEG, PNG and WebP images of varying dimensions. +smaller, web-friendly JPEG, PNG, WebP and AVIF images of varying dimensions. Resizing an image is typically 4x-5x faster than using the quickest ImageMagick and GraphicsMagick settings diff --git a/docs/api-channel.md b/docs/api-channel.md index a079bc7e..63c40bd7 100644 --- a/docs/api-channel.md +++ b/docs/api-channel.md @@ -70,7 +70,7 @@ Channel ordering follows vips convention: - sRGB: 0: Red, 1: Green, 2: Blue, 3: Alpha. - CMYK: 0: Magenta, 1: Cyan, 2: Yellow, 3: Black, 4: Alpha. -Buffers may be any of the image formats supported by sharp: JPEG, PNG, WebP, GIF, SVG, TIFF or raw pixel image data. +Buffers may be any of the image formats supported by sharp. For raw pixel input, the `options` object should contain a `raw` attribute, which follows the format of the attribute of the same name in the `sharp()` constructor. ### Parameters diff --git a/docs/api-constructor.md b/docs/api-constructor.md index a5ae63bf..b4ce10fe 100644 --- a/docs/api-constructor.md +++ b/docs/api-constructor.md @@ -4,7 +4,7 @@ Constructor factory to create an instance of `sharp`, to which further methods are chained. -JPEG, PNG, WebP or TIFF format image data can be streamed out from this object. +JPEG, PNG, WebP, AVIF or TIFF format image data can be streamed out from this object. When using Stream based output, derived attributes are available from the `info` event. Non-critical problems encountered during processing are emitted as `warning` events. @@ -14,9 +14,9 @@ Implements the [stream.Duplex][1] class. ### Parameters - `input` **([Buffer][2] \| [string][3])?** if present, can be - a Buffer containing JPEG, PNG, WebP, GIF, SVG, TIFF or raw pixel image data, or - a String containing the filesystem path to an JPEG, PNG, WebP, GIF, SVG or TIFF image file. - JPEG, PNG, WebP, GIF, SVG, TIFF or raw pixel image data can be streamed into the object when not present. + a Buffer containing JPEG, PNG, WebP, AVIF, GIF, SVG, TIFF or raw pixel image data, or + a String containing the filesystem path to an JPEG, PNG, WebP, AVIF, GIF, SVG or TIFF image file. + JPEG, PNG, WebP, AVIF, GIF, SVG, TIFF or raw pixel image data can be streamed into the object when not present. - `options` **[Object][4]?** if present, is an Object with optional attributes. - `options.failOnError` **[boolean][5]** by default halt processing and raise an error when loading invalid images. Set this flag to `false` if you'd rather apply a "best effort" to decode images, even if the data is corrupt or invalid. (optional, default `true`) @@ -26,8 +26,8 @@ Implements the [stream.Duplex][1] class. - `options.sequentialRead` **[boolean][5]** Set this to `true` to use sequential rather than random access where possible. This can reduce memory usage and might improve performance on some systems. (optional, default `false`) - `options.density` **[number][6]** number representing the DPI for vector images in the range 1 to 100000. (optional, default `72`) - - `options.pages` **[number][6]** number of pages to extract for multi-page input (GIF, TIFF, PDF), use -1 for all pages. (optional, default `1`) - - `options.page` **[number][6]** page number to start extracting from for multi-page input (GIF, TIFF, PDF), zero based. (optional, default `0`) + - `options.pages` **[number][6]** number of pages to extract for multi-page input (GIF, WebP, AVIF, TIFF, PDF), use -1 for all pages. (optional, default `1`) + - `options.page` **[number][6]** page number to start extracting from for multi-page input (GIF, WebP, AVIF, TIFF, PDF), zero based. (optional, default `0`) - `options.level` **[number][6]** level to extract from a multi-level input (OpenSlide), zero based. (optional, default `0`) - `options.animated` **[boolean][5]** Set to `true` to read all frames/pages of an animated image (equivalent of setting `pages` to `-1`). (optional, default `false`) - `options.raw` **[Object][4]?** describes raw pixel input image data. See `raw()` for pixel ordering. diff --git a/docs/api-output.md b/docs/api-output.md index f61988bf..c0cd43dd 100644 --- a/docs/api-output.md +++ b/docs/api-output.md @@ -5,7 +5,7 @@ Write output image data to a file. If an explicit output format is not selected, it will be inferred from the extension, -with JPEG, PNG, WebP, TIFF, DZI, and libvips' V format supported. +with JPEG, PNG, WebP, AVIF, TIFF, DZI, and libvips' V format supported. Note that raw pixel data is only supported for buffer output. By default all metadata will be removed, which includes EXIF-based orientation. @@ -42,7 +42,7 @@ Returns **[Promise][5]<[Object][6]>** when no callback is provided ## toBuffer Write output to a Buffer. -JPEG, PNG, WebP, TIFF and RAW output are supported. +JPEG, PNG, WebP, AVIF, TIFF and raw pixel data output are supported. If no explicit format is set, the output format will match the input image, except GIF and SVG input which become PNG output. diff --git a/docs/index.html b/docs/index.html index f12a402a..031b7057 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,7 +4,7 @@ - + |string|Buffer} images - one or more images (file paths, Buffers). diff --git a/lib/constructor.js b/lib/constructor.js index 22e702d8..afa5ade0 100644 --- a/lib/constructor.js +++ b/lib/constructor.js @@ -40,7 +40,7 @@ const debuglog = util.debuglog('sharp'); /** * Constructor factory to create an instance of `sharp`, to which further methods are chained. * - * JPEG, PNG, WebP or TIFF format image data can be streamed out from this object. + * JPEG, PNG, WebP, AVIF or TIFF format image data can be streamed out from this object. * When using Stream based output, derived attributes are available from the `info` event. * * Non-critical problems encountered during processing are emitted as `warning` events. @@ -91,9 +91,9 @@ const debuglog = util.debuglog('sharp'); * await sharp('in.gif', { animated: true }).toFile('out.webp'); * * @param {(Buffer|string)} [input] - if present, can be - * a Buffer containing JPEG, PNG, WebP, GIF, SVG, TIFF or raw pixel image data, or - * a String containing the filesystem path to an JPEG, PNG, WebP, GIF, SVG or TIFF image file. - * JPEG, PNG, WebP, GIF, SVG, TIFF or raw pixel image data can be streamed into the object when not present. + * a Buffer containing JPEG, PNG, WebP, AVIF, GIF, SVG, TIFF or raw pixel image data, or + * a String containing the filesystem path to an JPEG, PNG, WebP, AVIF, GIF, SVG or TIFF image file. + * JPEG, PNG, WebP, AVIF, GIF, SVG, TIFF or raw pixel image data can be streamed into the object when not present. * @param {Object} [options] - if present, is an Object with optional attributes. * @param {boolean} [options.failOnError=true] - by default halt processing and raise an error when loading invalid images. * Set this flag to `false` if you'd rather apply a "best effort" to decode images, even if the data is corrupt or invalid. @@ -103,8 +103,8 @@ const debuglog = util.debuglog('sharp'); * @param {boolean} [options.sequentialRead=false] - Set this to `true` to use sequential rather than random access where possible. * This can reduce memory usage and might improve performance on some systems. * @param {number} [options.density=72] - number representing the DPI for vector images in the range 1 to 100000. - * @param {number} [options.pages=1] - number of pages to extract for multi-page input (GIF, TIFF, PDF), use -1 for all pages. - * @param {number} [options.page=0] - page number to start extracting from for multi-page input (GIF, TIFF, PDF), zero based. + * @param {number} [options.pages=1] - number of pages to extract for multi-page input (GIF, WebP, AVIF, TIFF, PDF), use -1 for all pages. + * @param {number} [options.page=0] - page number to start extracting from for multi-page input (GIF, WebP, AVIF, TIFF, PDF), zero based. * @param {number} [options.level=0] - level to extract from a multi-level input (OpenSlide), zero based. * @param {boolean} [options.animated=false] - Set to `true` to read all frames/pages of an animated image (equivalent of setting `pages` to `-1`). * @param {Object} [options.raw] - describes raw pixel input image data. See `raw()` for pixel ordering. diff --git a/lib/output.js b/lib/output.js index 1f9de935..2331a249 100644 --- a/lib/output.js +++ b/lib/output.js @@ -20,7 +20,7 @@ const formats = new Map([ * Write output image data to a file. * * If an explicit output format is not selected, it will be inferred from the extension, - * with JPEG, PNG, WebP, TIFF, DZI, and libvips' V format supported. + * with JPEG, PNG, WebP, AVIF, TIFF, DZI, and libvips' V format supported. * Note that raw pixel data is only supported for buffer output. * * By default all metadata will be removed, which includes EXIF-based orientation. @@ -72,7 +72,7 @@ function toFile (fileOut, callback) { /** * Write output to a Buffer. - * JPEG, PNG, WebP, TIFF and RAW output are supported. + * JPEG, PNG, WebP, AVIF, TIFF and raw pixel data output are supported. * * If no explicit format is set, the output format will match the input image, except GIF and SVG input which become PNG output. * diff --git a/package.json b/package.json index 91234bf4..dade2ee5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sharp", - "description": "High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP and TIFF images", + "description": "High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images", "version": "0.27.0-beta1", "author": "Lovell Fuller ", "homepage": "https://github.com/lovell/sharp",