aboutsummaryrefslogtreecommitdiffstats
path: root/resize_img_files_to_max_400.sh
diff options
context:
space:
mode:
Diffstat (limited to 'resize_img_files_to_max_400.sh')
-rwxr-xr-xresize_img_files_to_max_400.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/resize_img_files_to_max_400.sh b/resize_img_files_to_max_400.sh
new file mode 100755
index 0000000..cceeae7
--- /dev/null
+++ b/resize_img_files_to_max_400.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# Navigate to the directory containing your images
+cd /home/lemon/code/html/jo-rebrand/img/
+
+# Loop through each image file
+for file in *.jpg *.JPG *.png *.gif; do
+ # Check if the file exists and is a regular file
+ if [ -f "$file" ]; then
+ # Resize the image using ImageMagick's convert command
+ convert "$file" -resize '400x>' "$file"
+ echo "Resized $file"
+ fi
+done
+