我发现了一个很好的npm包,可以让你读取和写入图像的Exif数据:https://github.com/Sobesednik/node-exiftool。
我的挑战是它需要你提供图像的路径。因此,如果您想使用此包修改EXIF,则必须将图像写入磁盘。是否有一种简单的方法来检查/读取EXIF,并在必要时将EXIF数据写入图像流?
我的挑战是它需要你提供图像的路径。因此,如果您想使用此包修改EXIF,则必须将图像写入磁盘。是否有一种简单的方法来检查/读取EXIF,并在必要时将EXIF数据写入图像流?
var imageURL = 'https://nodejs.org/static/images/logos/nodejs-new-pantone-black.png'
var upstreamServer = 'http://someupstreamserver/uploads'
request
.get(imageURL)
.pipe(
// TODO read EXIF
// TODO write missing EXIF
request
.post(upstreamServer, function(err, httpResponse, body){
res.send(201)
})
)
编辑:这个问题也在node-exiftool上被问到了。