I've searched stackoverflow and numerous websites for an answer to this. But I can't find any proper information regarding this. I am stuck.
I want to convert jpg into Webp by Using C++ dll file in nodejs. For this i Installed FFi Also, But getting error in Response. Can you Please Check my Code.
const ffi = require('ffi');
const ref = require('ref');
const fs = require('fs');
var int = ref.types.int ;
const dllFile = './WebpSdk.dll';
if (!fs.existsSync(dllFile)) {
throw (new Error('dll does not exist'));
}
const lib = ffi.Library(dllFile, {
'SelectSingleFile': [ 'bool', [ref.types.Object,ref.types.int] ]
});
const filepath ='./thumb/file.jpg';
console.log(lib.SelectSingleFile(filepath,1));//1 is FileType Like jpg
Getting this Error.
[nodemon] app crashed - waiting for file changes before starting...
C++ Dll Function SelectSingleFile Role.
//Select single file
BOOL bCheck = SelectSingleFile(PathName, ImageType);//SDK function
If bcheck true file is valid if false file is invalid.