prep-quartet-photos.sh (540B)
1 #!/bin/bash 2 3 set -euxo pipefail 4 5 declare -A heights=( 6 [sophie]=1100 7 [hervé]=1125 8 [enguerrand]=1175 9 [david]=1200 10 ) 11 12 processimg () 13 { 14 local src=$1 15 local name=$(basename "${src}") 16 name="${name%% *}" 17 name=${name,} 18 local dst=../images/${name}/full.png 19 local height=${heights[${name}]} 20 21 magick "${src}" -trim ${dst} 22 magick ${dst} -scale x${height} ${dst} 23 magick ${dst} -background none -gravity north -splice 0x$((1200-height)) ${dst} 24 } 25 26 for img in "$@" 27 do 28 processimg "${img}" & 29 done 30 31 wait