handle EXIF of jpg/jpeg, based on Exif2.31 2016
npm install xexif
var xexif = require("xexif")
1. load jpg/jpeg image file, return a arrayBuffer
var app1ArrayBuf = xexif.getArrayBufFromImgFile("./1.jpg")
2. decode APP1(thigs include EXIF) to a stage-0 Dict,but this raw-data-dict is not good for reading/writing
var app1s0 = xexif.decodeAPP1(app1ArrayBuf)
3. convert Dict of step3 to a more readable stage-1 Dict
var app1s1 = xexif.readable(app1s0)
4.search a tag(loose mode)
xexif.search("GPS",app1s1)
5.get a tag via a exact tagName ,which could be find in step 4
xexif.get("GPSImgDirection",app1s1)
6.doc for help and guide
xexif.listStructure()
xexif.listExifTags()
xexif.man("Orientation")
(Exchangeable image file format for digital still cameras: Exif Version 2.31 )
(optional)
(thanks to these two great projects)
1. ExifTool by Phil Harvey
2. exif-js
var xexif = require("xexif")
var app1ArrayBuf = xexif.getArrayBufFromImgFile("./1.jpg")
var app1s0 = xexif.decodeAPP1(app1ArrayBuf)
var app1s1 = xexif.readable(app1s0)
app1s1
xexif.search("GPS",app1s1)
xexif.get("GPSImgDirection",app1s1)
xexif.listStructure()
xexif.listExifTags()
xexif.man("Orientation")
1.write exif
2.encoder
3.MakerNote