Skip to content

Instantly share code, notes, and snippets.

@brb
Created April 8, 2017 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brb/114c8c965ba402c96c5efaad6cce6373 to your computer and use it in GitHub Desktop.
Save brb/114c8c965ba402c96c5efaad6cce6373 to your computer and use it in GitHub Desktop.
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