New to nodejs and really programming in general except some basic PHP. I think my problem is more basic javascript than anything though.
How can I access variables 'latitude' and 'longitude' outside the object 'img'?
console.log(latitude + '|' + longitude) is displaying the data I want but in console.log(img) all img properties are empty including exifData.gps.GPSLatitude & exifData.gps.GPSLongitude.
var ExifImage = require('exif').ExifImage;
var img_loc = 'c:/node/test/wherepic/uploaded_imgs/img.JPG';
var img = new ExifImage({ image : img_loc }, function (error, exifData) {
var latitude = exifData.gps.GPSLatitude;
var longitude = exifData.gps.GPSLongitude;
console.log(latitude + '|' + longitude);
});
console.log(img);