From d4c80593b91c77b7ec79f32b027a133f1e080259 Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Fri, 18 Apr 2025 19:02:27 +0000 Subject: [PATCH 1/2] Implement case control in committee script --- _scripts/committee.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/_scripts/committee.sh b/_scripts/committee.sh index 7c813d55..8228ca1e 100755 --- a/_scripts/committee.sh +++ b/_scripts/committee.sh @@ -16,6 +16,12 @@ if [[ -z "$committee" ]]; then exit 1 fi +for file in $committee/full/*; do + if [[ $file =~ [A-Z] ]]; then + mv $file `echo $file | tr '[:upper:]' '[:lower:]'` + fi +done + resolution="250x250" mkdir -p $committee/mini/ From c9b70c147ea31b9b76cac5d85992e4da70629aba Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Fri, 18 Apr 2025 19:51:24 +0000 Subject: [PATCH 2/2] Fix space handling --- _scripts/committee.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/_scripts/committee.sh b/_scripts/committee.sh index 8228ca1e..800a5d76 100755 --- a/_scripts/committee.sh +++ b/_scripts/committee.sh @@ -16,16 +16,17 @@ if [[ -z "$committee" ]]; then exit 1 fi -for file in $committee/full/*; do - if [[ $file =~ [A-Z] ]]; then - mv $file `echo $file | tr '[:upper:]' '[:lower:]'` +find "$committee/full/" -type f -print0 | while IFS= read -r -d '' file; do + if [[ "$file" =~ [A-Z] || "$file" =~ [[:space:]] ]]; then + mv "$file" "$(echo "$file" | tr '[:upper:]' '[:lower:]' | sed 's/ /_/g')" fi done resolution="250x250" mkdir -p $committee/mini/ -for picture in $committee/full/*; do + +find "$committee/full/" -type f -print0 | while IFS= read -r -d '' picture; do convert $picture -resize $resolution^ -gravity center -crop $resolution+0+0 $committee/mini/`basename $picture` done