diff --git a/utility/exif/94-exif.js b/utility/exif/94-exif.js index ff7e07e1..1f2e5d93 100644 --- a/utility/exif/94-exif.js +++ b/utility/exif/94-exif.js @@ -62,20 +62,22 @@ module.exports = function(RED) { else { node.log("The location of this image cannot be determined safely so no location information has been added to the message."); } - msg.location.arc = { - ranges: [500,1000,2000], - pan: gpsData.GPSImgDirection, - fov: (2 * Math.atan(36 / (2 * msg.exif.exif.FocalLengthIn35mmFormat)) * 180 / Math.PI), - color: '#910000' + if (msg.location) { + msg.location.arc = { + ranges: [500,1000,2000], + pan: gpsData.GPSImgDirection, + fov: (2 * Math.atan(36 / (2 * msg.exif.exif.FocalLengthIn35mmFormat)) * 180 / Math.PI), + color: '#910000' + } + msg.location.icon = "fa-camera"; + var na; + if (val.hasOwnProperty("name")) { na = val.name; } + else if (msg.hasOwnProperty("filename")) { na = msg.filename.split('/').pop(); } + else { na = msg.exif.image.Make+"_"+msg.exif.image.ModifyDate; } + msg.location.name = na; + msg.location.layer = "Images"; + msg.location.popup = '' } - msg.location.icon = "fa-camera"; - var na; - if (val.hasOwnProperty("name")) { na = val.name; } - else if (msg.hasOwnProperty("filename")) { na = msg.filename.split('/').pop(); } - else { na = msg.exif.image.Make+"_"+msg.exif.image.ModifyDate; } - msg.location.name = na; - msg.location.layer = "Images"; - msg.location.popup = '' } this.on("input", function(msg) { diff --git a/utility/exif/package.json b/utility/exif/package.json index 89c587d5..97510733 100644 --- a/utility/exif/package.json +++ b/utility/exif/package.json @@ -1,6 +1,6 @@ { "name": "node-red-node-exif", - "version": "0.2.1", + "version": "0.2.2", "description": "A Node-RED node that extracts Exif information from JPEG image buffers.", "dependencies": { "exif": "^0.6.0"