19 lines
713 B
Bash
Executable File
19 lines
713 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
|
|
# Backup originals once
|
|
mkdir -p output_webp_backup
|
|
cp --no-clobber output_webp/*.svg output_webp_backup/ || true
|
|
|
|
# Convert strokes to filled shapes and force a solid fill
|
|
FILL="#ffffff" # solid white interior for mask; stroke stays black for outline
|
|
for f in output_webp/*.svg; do
|
|
echo "Fixing $f"
|
|
inkscape "$f" --batch-process \
|
|
--actions="select-all;object-stroke-to-path;object-to-path;object-set-attribute:fill,$FILL;object-set-attribute:stroke,#000000;object-set-attribute:fill-rule,evenodd;object-set-attribute:style," \
|
|
--export-type=svg --export-filename="$f" --export-overwrite
|
|
done
|
|
|
|
echo "Done. Originals in output_webp_backup/"
|