mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Docs: add example of how to set EXIF GPS metadata
This commit is contained in:
parent
5f8646d937
commit
d6b60a60c6
@ -140,12 +140,18 @@ sharp('input.jpg')
|
|||||||
```
|
```
|
||||||
**Example**
|
**Example**
|
||||||
```js
|
```js
|
||||||
// Set "IFD0-Copyright" in output EXIF metadata
|
// Set output EXIF metadata
|
||||||
const data = await sharp(input)
|
const data = await sharp(input)
|
||||||
.withMetadata({
|
.withMetadata({
|
||||||
exif: {
|
exif: {
|
||||||
IFD0: {
|
IFD0: {
|
||||||
Copyright: 'Wernham Hogg'
|
Copyright: 'The National Gallery'
|
||||||
|
},
|
||||||
|
IFD3: {
|
||||||
|
GPSLatitudeRef: 'N',
|
||||||
|
GPSLatitude: '51/1 30/1 3230/100',
|
||||||
|
GPSLongitudeRef: 'W',
|
||||||
|
GPSLongitude: '0/1 7/1 4366/100'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -177,12 +177,18 @@ function toBuffer (options, callback) {
|
|||||||
* .then(info => { ... });
|
* .then(info => { ... });
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* // Set "IFD0-Copyright" in output EXIF metadata
|
* // Set output EXIF metadata
|
||||||
* const data = await sharp(input)
|
* const data = await sharp(input)
|
||||||
* .withMetadata({
|
* .withMetadata({
|
||||||
* exif: {
|
* exif: {
|
||||||
* IFD0: {
|
* IFD0: {
|
||||||
* Copyright: 'Wernham Hogg'
|
* Copyright: 'The National Gallery'
|
||||||
|
* },
|
||||||
|
* IFD3: {
|
||||||
|
* GPSLatitudeRef: 'N',
|
||||||
|
* GPSLatitude: '51/1 30/1 3230/100',
|
||||||
|
* GPSLongitudeRef: 'W',
|
||||||
|
* GPSLongitude: '0/1 7/1 4366/100'
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* })
|
* })
|
||||||
|
Loading…
x
Reference in New Issue
Block a user