diff options
Diffstat (limited to 'admin/prep-quartet-photos.sh')
| -rwxr-xr-x | admin/prep-quartet-photos.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/admin/prep-quartet-photos.sh b/admin/prep-quartet-photos.sh new file mode 100755 index 0000000..fa5264f --- /dev/null +++ b/admin/prep-quartet-photos.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +set -euxo pipefail + +declare -A heights=( + [sophie]=1100 + [hervé]=1125 + [enguerrand]=1175 + [david]=1200 +) + +processimg () +{ + local src=$1 + local name=$(basename "${src}") + name="${name%% *}" + name=${name,} + local dst=../images/${name}/full.png + local height=${heights[${name}]} + + magick "${src}" -trim ${dst} + magick ${dst} -scale x${height} ${dst} + magick ${dst} -background none -gravity north -splice 0x$((1200-height)) ${dst} +} + +for img in "$@" +do + processimg "${img}" & +done + +wait |
