project clean-up
This commit is contained in:
17
scripts/process-images.sh
Executable file
17
scripts/process-images.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
IMG_ORIGINALS="img_original"
|
||||
IMG_PUBLIC="all_paw_care/static/img"
|
||||
IMG_SIZES_NAME=("sm" "md" "lg" "xl" "xxl")
|
||||
IMG_SIZES=("346" "461" "595" "720" "840")
|
||||
|
||||
for img in $(find $IMG_ORIGINALS -type f)
|
||||
do
|
||||
for ((i=0;i<${#IMG_SIZES_NAME[@]};i++))
|
||||
do
|
||||
new_img_path=$(echo "$img" | sed -e "s,img_original\(.*\),$IMG_PUBLIC\1,g" \
|
||||
-e "s,\.,_${IMG_SIZES_NAME[i]}\.,g")
|
||||
magick "$img" -filter spline -resize ${IMG_SIZES[i]} "$new_img_path"
|
||||
done
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user