update
This commit is contained in:
25
APP/nexus-remote/build-icon.js
Normal file
25
APP/nexus-remote/build-icon.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const sharp = require('sharp');
|
||||
const { default: pngToIco } = require('png-to-ico');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
async function build() {
|
||||
const svgPath = path.join(__dirname, 'icon.svg');
|
||||
const pngPath = path.join(__dirname, 'icon.png');
|
||||
const icoPath = path.join(__dirname, 'icon.ico');
|
||||
|
||||
console.log('SVG -> PNG (256x256)...');
|
||||
await sharp(svgPath)
|
||||
.resize(256, 256)
|
||||
.png()
|
||||
.toFile(pngPath);
|
||||
|
||||
console.log('PNG -> ICO...');
|
||||
const pngBuf = fs.readFileSync(pngPath);
|
||||
const icoBuf = await pngToIco(pngBuf);
|
||||
fs.writeFileSync(icoPath, icoBuf);
|
||||
|
||||
console.log('Fertig: icon.png + icon.ico erstellt');
|
||||
}
|
||||
|
||||
build().catch((e) => { console.error(e); process.exit(1); });
|
||||
Reference in New Issue
Block a user