make exif node add exif data even if gps missing (#393)

This commit is contained in:
JJ Cantillon 2018-01-08 01:26:57 +10:00 committed by Dave Conway-Jones
parent 032a9d6435
commit 29694dd2cb
1 changed files with 8 additions and 4 deletions

View File

@ -73,13 +73,17 @@ module.exports = function(RED) {
node.log(error.toString()); node.log(error.toString());
} }
else { else {
//msg.payload remains the same buffer if (exifData) {
if ((exifData) && (exifData.hasOwnProperty("gps")) && (Object.keys(exifData.gps).length !== 0)) {
msg.exif = 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 { 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); node.send(msg);