forked from scionoftech/webp-converter
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgwebp_test.js
19 lines (18 loc) · 862 Bytes
/
gwebp_test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var path = require('path');
//get os type then return path of respective platform library
var knowos = function () {
if (process.platform === 'darwin') {
return path.join(__dirname, '/lib/libwebp_osx/bin/gif2webp');//return osx library path
} else if (process.platform === 'linux') {
return path.join(__dirname, '/lib/libwebp_linux/bin/gif2webp');//return linux library path
} else if (process.platform === 'win32') {
if (process.arch === 'x64') {
return path.join(__dirname, '/lib/libwebp_win64/bin/gif2webp.exe');//return windows 64bit library path
} else {
return path.join(__dirname, '/lib/libwebp_win32/bin/gif2webp.exe');//return windows 32(X86)bit library path
}
} else {
console.log('Unsupported platform:', process.platform, process.arch);//show unsupported platform message
}
};
module.exports = knowos;