Saturday 8 April 2017

Write EXIF data to image stream Node.js

I found a nice npm package that allows you to read and write Exif data to images, https://github.com/Sobesednik/node-exiftool.

The challenge that I have is that it requires you to provide the path to an image. So, the image has to be written to disk if you want to modify the EXIF using this package. Is there an easy way to check/read the EXIF, and if necessary, write EXIF data to an image stream?

var imageURL = 'https://nodejs.org/static/images/logos/nodejs-new-pantone-black.png'
var upstreamServer = 'http://someupstreamserver/uploads'

request
  .get(sourceUrl)
  .pipe(
      // TODO read EXIF
      // TODO write missing EXIF
      request
        .post(upstreamServer, function(err, httpResponse, body){
          res.send(201)
      })
  )



via tom

No comments:

Post a Comment