Files
harheimertc/scripts/anonymize-playstore-screenshot.sh
Torsten Schulz (local) 67c746f18b
Some checks failed
Code Analysis and Production Deploy / deploy-production (push) Has been cancelled
Code Analysis and Production Deploy / deploy-test (push) Has been cancelled
Code Analysis and Production Deploy / analyze (push) Has been cancelled
Add script to generate Play Store screenshot sizes
- Introduced a Node.js script (`playstore-screenshot-sizes.mjs`) to resize images for Play Store screenshots based on predefined profiles (phone, tablet-7, tablet-10).
- The script reads images from a specified input directory, processes them, and saves the resized images in an output directory with appropriate naming conventions.
- Added a Bash wrapper script (`playstore-screenshot-sizes.sh`) to execute the Node.js script easily from the command line.
2026-05-30 00:30:50 +02:00

33 lines
733 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
if [[ $# -lt 3 ]]; then
echo "Nutzung: $0 <input.png> <output.png> <rects>"
echo "rects Format: x,y,w,h;x,y,w,h"
echo "Beispiel: $0 shot.png shot-anon.png '80,120,420,70;72,720,540,90'"
exit 1
fi
INPUT="$1"
OUTPUT="$2"
RECTS="$3"
if ! command -v magick >/dev/null 2>&1; then
echo "Fehler: 'magick' (ImageMagick) ist nicht installiert."
exit 1
fi
TMP="$OUTPUT.tmp.png"
cp "$INPUT" "$TMP"
IFS=';' read -r -a BOXES <<< "$RECTS"
for box in "${BOXES[@]}"; do
IFS=',' read -r x y w h <<< "$box"
magick "$TMP" \
\( -size "${w}x${h}" xc:black -alpha off \) \
-geometry "+${x}+${y}" -composite "$TMP"
done
mv "$TMP" "$OUTPUT"
echo "Anonymisierte Datei geschrieben: $OUTPUT"