Skip to content

Instantly share code, notes, and snippets.

@jordanthomas
Created August 14, 2013 14:59
Show Gist options
  • Save jordanthomas/6231843 to your computer and use it in GitHub Desktop.
Save jordanthomas/6231843 to your computer and use it in GitHub Desktop.
Create thumbnails from images in current directory.
#!/bin/bash
images=$(ls | grep -e '.[jpg|png]$')
for image in $images
do
base=$(basename "$image")
name="${base%.*}"
echo "Thumbnailing $image..."
convert "$image" -thumbnail 140x140^ -gravity center -extent 140x140 "${name}_thumb.jpg"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment