Files
webspeak3/web/scripts/generate-icons.sh
T
Moepchi ddf4f149f7 Add WebSpeak3 logo, favicons, and Open Graph preview image
Wires the official logo into the header, README, and browser tab; generates
favicon.ico/apple-touch-icon/OG image via a new ImageMagick script from a
single source PNG at web/public/logo.png.
2026-07-30 16:34:39 +02:00

24 lines
976 B
Bash

#!/usr/bin/env bash
# Generates every derived favicon/OG-image size from the single source logo
# at web/public/logo.png. Requires ImageMagick (`magick` on the PATH).
#
# Usage: run from web/ after dropping the source logo at public/logo.png:
# bash scripts/generate-icons.sh
set -euo pipefail
cd "$(dirname "$0")/.."
SRC=public/logo.png
if [ ! -f "$SRC" ]; then
echo "Missing $SRC - drop the source logo there first (square PNG, >=512x512, transparent background)." >&2
exit 1
fi
magick "$SRC" -resize 32x32 public/favicon-32.png
magick "$SRC" -resize 192x192 public/favicon-192.png
magick "$SRC" -resize 180x180 -background white -alpha remove -alpha off public/apple-touch-icon.png
magick "$SRC" -define icon:auto-resize=16,32,48 public/favicon.ico
magick "$SRC" -resize 400x400 -background "#1e1e1e" -gravity center -extent 1200x630 public/og-image.png
echo "Generated favicon-32.png, favicon-192.png, apple-touch-icon.png, favicon.ico, og-image.png in public/"