From 69b129b00d3a4d56de276eaba31ee0b67285dfab Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 28 Oct 2024 09:15:55 +0000 Subject: Resizes the images before sending them --- post_images_to_t24s.bash | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/post_images_to_t24s.bash b/post_images_to_t24s.bash index 49926ea..07dcf6c 100755 --- a/post_images_to_t24s.bash +++ b/post_images_to_t24s.bash @@ -2,7 +2,7 @@ if [[ "$#" -ne 2 ]]; then printf "\n\nUsage: post_images_to_t24s.bash TITLE SOURCEDIR_NAME\nTITLE should be lowercase with no spaces.\nSOURCEDIR_NAME is directory containing optimised JPGs.\n\ -Don't be IN the sourcedir - point to it and don't bother with slashes.\n\nExample: post_images_to_t24s.bash day-out-in-berwick thumbnails.\n\n" +Don't be IN the sourcedir, but be in the directory where the JPGs are you need to resize. Don't bother with slashes.\n\nExample: post_images_to_t24s.bash day-out-in-berwick thumbnails.\n\n" exit 1 fi @@ -10,4 +10,8 @@ date=$(date +'%Y-%m-%d') title=$1 sourcedir=$2 +echo "Resizing the images..." +magick mogrify -path "$sourcedir" -resize 30% -quality 80 *.jpg + +echo "Pushing to the server..." rsync -avz "$(pwd)/$sourcedir/" pachelbel:/var/www/twentyfoursoftware.co.uk/pub/images/"$date-$title/" -- cgit v1.2.3