2019-06-10 18:59:51 +02:00
|
|
|
const fs = require('fs');
|
|
|
|
const sharp = require('sharp');
|
|
|
|
|
|
|
|
const folder = './processedImages/';
|
|
|
|
|
|
|
|
if (!fs.existsSync(folder)) {
|
|
|
|
fs.mkdirSync(folder);
|
|
|
|
}
|
|
|
|
|
|
|
|
const favicon = sharp('./src/images/favicon.svg');
|
|
|
|
|
2019-07-18 00:25:22 +02:00
|
|
|
sharp('./src/images/social.jpg').toFile(folder + 'social.jpg', (err, info) => {
|
2019-06-10 19:52:37 +02:00
|
|
|
if (err) return console.error(err);
|
|
|
|
console.log(info);
|
|
|
|
});
|
|
|
|
|
2019-06-10 18:59:51 +02:00
|
|
|
favicon.clone().resize(32, 32).toFile(folder + 'favicon.png', (err, info) => {
|
|
|
|
if (err) return console.error(err);
|
|
|
|
console.log(info);
|
|
|
|
});
|
|
|
|
|
|
|
|
favicon.clone().resize(128, 128).toFile(folder + 'icon-128.png', (err, info) => {
|
|
|
|
if (err) return console.error(err);
|
|
|
|
console.log(info);
|
|
|
|
});
|
|
|
|
|
|
|
|
favicon.clone().resize(144, 144).toFile(folder + 'icon-144.png', (err, info) => {
|
|
|
|
if (err) return console.error(err);
|
|
|
|
console.log(info);
|
|
|
|
});
|
|
|
|
|
|
|
|
favicon.clone().resize(152, 152).toFile(folder + 'icon-152.png', (err, info) => {
|
|
|
|
if (err) return console.error(err);
|
|
|
|
console.log(info);
|
|
|
|
});
|
|
|
|
|
|
|
|
favicon.clone().resize(192, 192).toFile(folder + 'icon-192.png', (err, info) => {
|
|
|
|
if (err) return console.error(err);
|
|
|
|
console.log(info);
|
|
|
|
});
|
|
|
|
|
|
|
|
favicon.clone().resize(256, 256).toFile(folder + 'icon-256.png', (err, info) => {
|
|
|
|
if (err) return console.error(err);
|
|
|
|
console.log(info);
|
|
|
|
});
|
|
|
|
|
|
|
|
favicon.clone().resize(512, 512).toFile(folder + 'icon-512.png', (err, info) => {
|
|
|
|
if (err) return console.error(err);
|
|
|
|
console.log(info);
|
|
|
|
});
|