From 29694dd2cba5f0e8b3d5c6b6dba177890ef39105 Mon Sep 17 00:00:00 2001 From: JJ Cantillon Date: Mon, 8 Jan 2018 01:26:57 +1000 Subject: [PATCH] make exif node add exif data even if gps missing (#393) --- utility/exif/94-exif.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/utility/exif/94-exif.js b/utility/exif/94-exif.js index e4cbb887..316e04f9 100644 --- a/utility/exif/94-exif.js +++ b/utility/exif/94-exif.js @@ -73,13 +73,17 @@ module.exports = function(RED) { node.log(error.toString()); } else { - //msg.payload remains the same buffer - if ((exifData) && (exifData.hasOwnProperty("gps")) && (Object.keys(exifData.gps).length !== 0)) { + if (exifData) { msg.exif = exifData; - addMsgLocationDataFromExifGPSData(msg); + if((exifData.hasOwnProperty("gps")) && (Object.keys(exifData.gps).length !== 0)) { + addMsgLocationDataFromExifGPSData(msg); + } + else { + node.log("The incoming image did not contain Exif GPS data."); + } } else { - node.warn("The incoming image did not contain Exif GPS data, nothing to do. "); + node.warn("The incoming image did not contain any Exif data, nothing to do. "); } } node.send(msg);