27 lines
733 B
JavaScript
27 lines
733 B
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Creates a 64x64 icon from test-flyer-image.png
|
|
* Run from container: node scripts/create-test-icon.js
|
|
*/
|
|
|
|
import sharp from 'sharp';
|
|
import path from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
|
|
const inputPath = path.join(__dirname, '../src/tests/assets/test-flyer-image.png');
|
|
const outputPath = path.join(__dirname, '../src/tests/assets/test-flyer-icon.png');
|
|
|
|
sharp(inputPath)
|
|
.resize(64, 64, { fit: 'cover' })
|
|
.toFile(outputPath)
|
|
.then(() => {
|
|
console.log(`✓ Created icon: ${outputPath}`);
|
|
})
|
|
.catch((err) => {
|
|
console.error('Error creating icon:', err);
|
|
process.exit(1);
|
|
});
|