// Quick script to resize OpenNotion icon for extension
// Uses Node.js canvas (no external deps, just file manipulation)
const fs = require('fs');
const { createCanvas, loadImage } = require('canvas');

async function main() {
    const src = 'e:/opennotion/frontend/public/android-chrome-192x192.png';
    const sizes = [16, 48, 128];

    const img = await loadImage(src);

    for (const size of sizes) {
        const canvas = createCanvas(size, size);
        const ctx = canvas.getContext('2d');
        ctx.drawImage(img, 0, 0, size, size);

        const buf = canvas.toBuffer('image/png');
        fs.writeFileSync(`e:/opennotion/extension/icons/icon${size}.png`, buf);
        console.log(`icon${size}.png created`);
    }
}

main().catch(console.error);
