Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
vagabonds-img-resize.sh
#!/bin/sh
DIR="$1"
#echo "Renaming JPG -> jpg ..."
#for f in $DIR/*; do
# mv "$f" $(echo "$f" | tr '[:upper:]' '[:lower:]')
#done
for f in $DIR/*; do
#size=$(identify $f | awk '{print $3}')
#width=$(echo $size | cut -dx -f1)
#height=$(echo $size | cut -dx -f2)
#convert $f -resize 320 $
fn=$(basename "$f")
pref="${fn%.*}"
convert $f -resize 320 "$DIR/${pref}-small.jpg"
#echo "$f $width $height $ratio"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment