mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Docs: clarify that metadata is based on input, not output
This commit is contained in:
@@ -2,7 +2,11 @@
|
||||
|
||||
## 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.
|
||||
|
||||
* `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
|
||||
|
||||
```javascript
|
||||
const metadata = await sharp(input).metadata();
|
||||
```
|
||||
|
||||
```javascript
|
||||
const image = sharp(inputJpg);
|
||||
image
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user