mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Docs: clarify that metadata is based on input, not output
This commit is contained in:
parent
dd6583044b
commit
2b8e4d20de
@ -2,7 +2,11 @@
|
|||||||
|
|
||||||
## metadata
|
## metadata
|
||||||
|
|
||||||
Fast access to (uncached) image metadata without decoding any compressed image data.
|
Fast access to (uncached) image metadata without decoding any compressed pixel data.
|
||||||
|
|
||||||
|
This is taken from the header of the input image.
|
||||||
|
It does not include operations, such as resize, to be applied to the output image.
|
||||||
|
|
||||||
A `Promise` is returned when `callback` is not provided.
|
A `Promise` is returned when `callback` is not provided.
|
||||||
|
|
||||||
* `format`: Name of decoder used to decompress image data e.g. `jpeg`, `png`, `webp`, `gif`, `svg`
|
* `format`: Name of decoder used to decompress image data e.g. `jpeg`, `png`, `webp`, `gif`, `svg`
|
||||||
@ -39,6 +43,10 @@ A `Promise` is returned when `callback` is not provided.
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const metadata = await sharp(input).metadata();
|
||||||
|
```
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const image = sharp(inputJpg);
|
const image = sharp(inputJpg);
|
||||||
image
|
image
|
||||||
|
File diff suppressed because one or more lines are too long
@ -290,7 +290,11 @@ function _isStreamInput () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fast access to (uncached) image metadata without decoding any compressed image data.
|
* Fast access to (uncached) image metadata without decoding any compressed pixel data.
|
||||||
|
*
|
||||||
|
* This is taken from the header of the input image.
|
||||||
|
* It does not include operations, such as resize, to be applied to the output image.
|
||||||
|
*
|
||||||
* A `Promise` is returned when `callback` is not provided.
|
* A `Promise` is returned when `callback` is not provided.
|
||||||
*
|
*
|
||||||
* - `format`: Name of decoder used to decompress image data e.g. `jpeg`, `png`, `webp`, `gif`, `svg`
|
* - `format`: Name of decoder used to decompress image data e.g. `jpeg`, `png`, `webp`, `gif`, `svg`
|
||||||
@ -322,6 +326,9 @@ function _isStreamInput () {
|
|||||||
* - `tifftagPhotoshop`: Buffer containing raw TIFFTAG_PHOTOSHOP data, if present
|
* - `tifftagPhotoshop`: Buffer containing raw TIFFTAG_PHOTOSHOP data, if present
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
|
* const metadata = await sharp(input).metadata();
|
||||||
|
*
|
||||||
|
* @example
|
||||||
* const image = sharp(inputJpg);
|
* const image = sharp(inputJpg);
|
||||||
* image
|
* image
|
||||||
* .metadata()
|
* .metadata()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user