modify-exif
Modify Exif data of a JPEG and create a new Buffer
const readFile = promises;const getExif = ;const modifyExif = ; async { // The original photo is taken at 2017:11:19 08:47:19 const originalFile = await ; Exif; //=> '2017:11:19 08:47:19' const newFile = ; Exif; //=> '2018:06:15 12:00:00'};
Installation
npm install modify-exif
API
const modifyExif = ;
modifyExif(buffer, modifierFn [, option])
buffer: Buffer
(data of a JPEG file)
modifierFn: Function
(a function to transform a passed Object
inside it)
option: Object
Return: Object
It reads Exif data from a Buffer
using Piexifjs, pass it to the modifier function and return a new Buffer
of the image with updated Exif data.
Note that the original Buffer
is not modified.
const newBuffer = ;
option.keepDateTime
Type: boolean
Default: false
By default DataTime
tag (file change date and time) of the 0th IFD is updated to the current date and time.
true
disables this behavior.
License
ISC License © 2018 Shinnosuke Watanabe