Files
beStream/scripts/generate-icon-svg.js
kharonsec bf6dcdabd0
Some checks failed
CI / Lint & Type Check (push) Failing after 56s
CI / Tests (push) Successful in 1m14s
CI / Build Web (push) Has been skipped
CI / Security Scan (push) Successful in 45s
CI / Build Electron (Linux) (push) Has been skipped
CI / Build Tauri (ubuntu-latest) (push) Has been skipped
CI / Build Electron (Windows) (push) Has been cancelled
CI / Build Tauri (windows-latest) (push) Has been cancelled
Series now work and movies too, still needs lots of testing and polishing.
2026-01-15 11:10:32 +01:00

29 lines
870 B
JavaScript

import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const rootDir = path.join(__dirname, '..');
const iconPngPath = path.join(rootDir, 'public', 'icon.png');
const iconSvgPath = path.join(rootDir, 'public', 'icon.svg');
// Read the PNG file and convert to base64
const pngBuffer = fs.readFileSync(iconPngPath);
const base64Image = pngBuffer.toString('base64');
// Create SVG that embeds the PNG
const svgContent = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 512 512">
<image width="512" height="512" xlink:href="data:image/png;base64,${base64Image}"/>
</svg>`;
// Write the SVG file
fs.writeFileSync(iconSvgPath, svgContent);
console.log('✓ Generated icon.svg from icon.png');