summaryrefslogtreecommitdiff
path: root/admin
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2021-03-23 22:23:48 +0100
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2021-03-23 22:35:45 +0100
commitea06e107f2ab831de4f9c69c3917541b2fc52e1a (patch)
treec9e58e8cedffc956dfcaed44606ce48bbafe1475 /admin
parent476d314bb48a643a6123e9dcb11943dbd00048db (diff)
downloadquatuorbellefeuille.com-ea06e107f2ab831de4f9c69c3917541b2fc52e1a.tar.xz
Use Pierre's re-tinted photos
Diffstat (limited to 'admin')
-rwxr-xr-xadmin/prep-quartet-photos.sh31
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