chore: add jimp dependency, icon padding script, and update configuration

This commit is contained in:
2026-05-31 14:04:37 +02:00
parent 30f81045ac
commit 7cd17307ba
1126 changed files with 166400 additions and 2 deletions
+29
View File
@@ -0,0 +1,29 @@
const fs = require('fs');
const path = require('path');
// Fallback to Jimp if sharp is not available
try {
const Jimp = require('jimp');
async function padIconJimp() {
console.log('Padding icon using Jimp...');
const img = await Jimp.read('Icon.png');
// Scale down image to fit within 720x720 while maintaining aspect ratio
img.scaleToFit(720, 720);
// Create a transparent 1080x1080 background
const bg = new Jimp(1080, 1080, 0x00000000);
// Center the scaled image on the background
const x = (1080 - img.bitmap.width) / 2;
const y = (1080 - img.bitmap.height) / 2;
bg.composite(img, x, y);
await bg.writeAsync('Icon-padded.png');
console.log('Icon successfully padded to Icon-padded.png');
}
padIconJimp().catch(console.error);
} catch (e) {
console.log('Jimp not found. Please install it first using: npm install jimp --no-save');
}