summaryrefslogtreecommitdiff
path: root/assets/icons/icongen.js
blob: 694b0636dc449cdb11144faa381bf370d300adc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const fs = require('fs');
const exec = require('child_process').execSync;
const path = require('path');

let files = fs.readdirSync(".").filter(i => i.endsWith(".svg"));

for (let file of files) {
    let name = file.substring(0, file.length - path.extname(file).length);

    console.log(name);
    exec("convert -density 1200 -resize 1000x1000 -channel RGB -depth 32 -negate -background none " + file + " ./favicon/" + name + "-pre.png");
    exec("convert -composite -compose Dst_Over -gravity center -depth 32 -geometry 1026x1026 ./favicon/" + name + "-pre.png ../logo/logo-template.png -set colorspace RGB ./favicon/" + name + ".png");

    fs.unlinkSync("./favicon/" + name + "-pre.png");
}