diff --git a/Gruntfile.js b/Gruntfile.js index c67e8bf8..eb95615c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -17,7 +17,7 @@ module.exports = function(grunt) { }, jshint: { options: { - jshintrc:true // Use external jshinrc file configured as below + jshintrc:true // Use external jshintrc file configured as below // http://www.jshint.com/docs/options/ //"asi": true, // allow missing semicolons //"curly": true, // require braces diff --git a/package.json b/package.json index 9ddde59b..0f2aa5a7 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "feedparser": "^2.2.10", "grunt": "^1.6.1", "grunt-cli": "^1.4.3", - "grunt-contrib-jshint": "^2.1.0", + "grunt-contrib-jshint": "^3.2.0", "grunt-jscs": "^3.0.1", "grunt-lint-inline": "^1.0.0", "grunt-simple-mocha": "^0.4.1", @@ -46,7 +46,7 @@ "msgpack-lite": "^0.1.26", "multilang-sentiment": "^1.2.0", "ngeohash": "^0.6.3", - "node-red": "^3.1.0", + "node-red": "^4.0.1", "node-red-node-test-helper": "^0.3.2", "nodemailer": "^6.9.7", "node-pop3": "^0.9.0", diff --git a/test/utility/exif/94-exif_spec.js b/test/utility/exif/94-exif_spec.js index 6a5460e9..f135997e 100644 --- a/test/utility/exif/94-exif_spec.js +++ b/test/utility/exif/94-exif_spec.js @@ -53,8 +53,8 @@ describe('exif node', function() { helperNode1.on("input", function(msg) { // exif.ExifImage.restore(); - msg.location.lat.should.equal(51.04365); // this data is stored in the jpg file - msg.location.lon.should.equal(-1.31525); + msg.location.lat.should.equal(51.04364722222222); // this data is stored in the jpg file + msg.location.lon.should.equal(-1.3152472222222222); done(); }); @@ -117,9 +117,9 @@ describe('exif node', function() { var logEvents = helper.log().args.filter(function(evt) { return evt[0].type == "exif"; }); - logEvents.should.have.length(1); - logEvents[0][0].should.have.a.property('msg'); - logEvents[0][0].msg.toString().should.startWith("Error: The given image is not a JPEG"); + logEvents.should.have.length(2); + logEvents[1][0].should.have.a.property('msg'); + logEvents[1][0].msg.toString().should.startWith("Error: Invalid image format"); done(); },150); diff --git a/utility/exif/94-exif.js b/utility/exif/94-exif.js index 421eed74..135cae6b 100644 --- a/utility/exif/94-exif.js +++ b/utility/exif/94-exif.js @@ -90,9 +90,11 @@ module.exports = function(RED) { if (Buffer.isBuffer(value)) { // or a proper jpg buffer msg.exif = ExifReader.load(msg.payload); for (const p in msg.exif) { - msg.exif[p] = msg.exif[p].description - if (!isNaN(Number(msg.exif[p]))) { - msg.exif[p] = Number(msg.exif[p]) + if (msg.exif.hasOwnProperty(p)) { + msg.exif[p] = msg.exif[p].description + if (!isNaN(Number(msg.exif[p]))) { + msg.exif[p] = Number(msg.exif[p]) + } } } if (msg.exif && msg.exif.hasOwnProperty("GPSLatitude") && msg.exif.hasOwnProperty("GPSLongitude")) {