mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Bump test coverage for Exif node.
Remove dependancy on actual jpg files.
This commit is contained in:
@@ -37,16 +37,15 @@ module.exports = function(RED) {
|
||||
*/
|
||||
function addMsgLocationDataFromExifGPSData(msg) {
|
||||
var gpsData = msg.exif.gps; // declaring variable purely to make checks more readable
|
||||
if(gpsData.GPSAltitude) {
|
||||
if(!msg.location) {
|
||||
msg.location = {};
|
||||
}
|
||||
if (gpsData.GPSAltitude) {
|
||||
/* istanbul ignore else */
|
||||
if (!msg.location) { msg.location = {}; }
|
||||
msg.location.alt = gpsData.GPSAltitude;
|
||||
}
|
||||
if(gpsData.GPSLatitudeRef && gpsData.GPSLatitude && gpsData.GPSLongitudeRef && gpsData.GPSLongitude) { // location can be determined, OK
|
||||
if (gpsData.GPSLatitudeRef && gpsData.GPSLatitude && gpsData.GPSLongitudeRef && gpsData.GPSLongitude) { // location can be determined, OK
|
||||
// The data provided in Exif is in degrees, minutes, seconds, this is to be converted into a single floating point degree
|
||||
if(gpsData.GPSLatitude.length === 3) { // OK to convert latitude
|
||||
if(gpsData.GPSLongitude.length === 3) { // OK to convert longitude
|
||||
if (gpsData.GPSLatitude.length === 3) { // OK to convert latitude
|
||||
if (gpsData.GPSLongitude.length === 3) { // OK to convert longitude
|
||||
|
||||
var latitude = convertDegreesMinutesSecondsToDecimals(gpsData.GPSLatitude[0], gpsData.GPSLatitude[1], gpsData.GPSLatitude[2]);
|
||||
latitude = Math.round(latitude * 100000)/100000; // 5dp is approx 1m resolution...
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "node-red-node-exif",
|
||||
"version" : "0.0.2",
|
||||
"version" : "0.0.3",
|
||||
"description" : "A Node-RED node that extracts Exif information from JPEG image buffers.",
|
||||
"dependencies" : {
|
||||
"exif": "0.4.0"
|
||||
|
Reference in New Issue
Block a user