aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-10-28 09:15:55 +0000
committerMatthew Lemon <y@yulqen.org>2024-10-28 09:15:55 +0000
commit69b129b00d3a4d56de276eaba31ee0b67285dfab (patch)
treea12e0687138a6dce71ee7a58e2077f77899a0157
parent50fb8639b57f395691efb9cda4038dc678175228 (diff)
Resizes the images before sending them
-rwxr-xr-xpost_images_to_t24s.bash6
1 files changed, 5 insertions, 1 deletions
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/"