imagemagick javascript 1

imagemagick javascript

im.readMetadata('kittens.jpg', function(err, metadata){  if (err) throw err;  console.log('Shot at '+metadata.exif.dateTimeOriginal);  // -> Shot at Tue, 06 Feb 2007 21:13:54 GMT});

Here is what the above code is Doing:
1. We’re requiring the exif-parser module.
2. We’re creating a new instance of the ExifImage class.
3. We’re passing in the path to the image we want to read.
4. We’re passing in a callback function that will be called when the image has been read.
5. We’re logging the dateTimeOriginal property of the metadata object.

Similar Posts