opencv4nodejs-prebuilt
Advanced tools
Comparing version 4.15.1-beta2 to 4.15.1-beta3
@@ -1,9 +0,23 @@ | ||
const path = require('path'); | ||
const { resolvePath } = require('./commons'); | ||
const path = require("path"); | ||
const { resolvePath } = require("./commons"); | ||
let winLibsPath; | ||
if (process.env.BINDINGS_DEBUG) { | ||
winLibsPath = "../build/Debug/opencv4nodejs"; | ||
} else { | ||
winLibsPath = "../build/Release/opencv4nodejs"; | ||
} | ||
// ensure binaries are added to path on windows | ||
if (process.platform === "win32") { | ||
// append opencv binary path to node process | ||
if (!process.env.path.includes(winLibsPath)) { | ||
process.env.path = `${process.env.path};${winLibsPath};`; | ||
} | ||
} | ||
let cv; | ||
if (process.env.BINDINGS_DEBUG) { | ||
cv = require(path.join(__dirname, '../build/Debug/opencv4nodejs')); | ||
cv = require(path.join(__dirname, "../build/Debug/opencv4nodejs")); | ||
} else { | ||
cv = require(path.join(__dirname, '../build/Release/opencv4nodejs')); | ||
cv = require(path.join(__dirname, "../build/Release/opencv4nodejs")); | ||
} | ||
@@ -14,6 +28,16 @@ | ||
Object.keys(haarCascades).forEach( | ||
key => cv[key] = resolvePath(path.join(__dirname, './haarcascades'), haarCascades[key])); | ||
key => | ||
(cv[key] = resolvePath( | ||
path.join(__dirname, "./haarcascades"), | ||
haarCascades[key] | ||
)) | ||
); | ||
Object.keys(lbpCascades).forEach( | ||
key => cv[key] = resolvePath(path.join(__dirname, './lbpcascades'), lbpCascades[key])); | ||
key => | ||
(cv[key] = resolvePath( | ||
path.join(__dirname, "./lbpcascades"), | ||
lbpCascades[key] | ||
)) | ||
); | ||
module.exports = cv; |
@@ -13,3 +13,3 @@ const { join } = require("path"); | ||
const opencvInclude = join(opencvBuild, 'include'); | ||
const opencvLibDir = isWin() ? join(opencvBuild, 'lib/Release') : join(opencvBuild, 'lib'); | ||
const opencvLibDir = isWin() ? join(opencvBuild, 'bin/Release') : join(opencvBuild, 'lib'); | ||
const opencvBinDir = isWin() ? join(opencvBuild, 'bin/Release') : join(opencvBuild, 'bin'); | ||
@@ -16,0 +16,0 @@ |
@@ -31,6 +31,1 @@ const opencvBuild = require(`@nut-tree/opencv-build-${process.platform}`); | ||
opencvBuild.opencvModules.filter(lib => desiredModules.includes(lib)).forEach(lib => console.log(`-lopencv_${lib}`)); | ||
if (process.env.BINDINGS_DEBUG) { | ||
console.log('-Wl,-rpath,../build/Debug/opencv4nodejs'); | ||
} else { | ||
console.log('-Wl,-rpath,../build/Release/opencv4nodejs'); | ||
} |
{ | ||
"name": "opencv4nodejs-prebuilt", | ||
"version": "4.15.1-beta2", | ||
"version": "4.15.1-beta3", | ||
"description": "This is a fork of opencv4nodejs which provides pre-built binaries", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
10513221
2289
17