Migrate to vite
All checks were successful
Check & deploy / validate (push) Successful in 3m0s
Check & deploy / deploy (push) Successful in 55s

This commit is contained in:
Andras Schmelczer 2026-05-31 13:23:10 +01:00
parent 1914991250
commit 5bdf68eabd
10 changed files with 611 additions and 56 deletions

View file

@ -0,0 +1,37 @@
import { readdir } from 'node:fs/promises';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import sharp from 'sharp';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const rootDir = path.resolve(__dirname, '..');
const pictureDir = path.join(rootDir, 'src/pictures');
const files = (await readdir(pictureDir)).filter((file) =>
file.toLowerCase().endsWith('.jpg')
);
const offenders = [];
for (const file of files) {
const metadata = await sharp(path.join(pictureDir, file)).metadata();
if (metadata.exif || metadata.xmp || metadata.iptc) {
offenders.push(file);
}
}
if (offenders.length > 0) {
console.error('Private image metadata found in source photos:');
for (const file of offenders) {
console.error(`- ${file}`);
}
console.error(
'Run `node scripts/strip-image-metadata.mjs` and review the image changes.'
);
process.exit(1);
}
console.log(
`Checked ${files.length} source photos for EXIF/XMP/IPTC metadata.`
);