Skip to content

Instantly share code, notes, and snippets.

@tygor
Forked from anonymous/makeThumbs.sh
Last active December 10, 2015 06:08
Show Gist options
  • Save tygor/4392411 to your computer and use it in GitHub Desktop.
Save tygor/4392411 to your computer and use it in GitHub Desktop.
#!/bin/bash
# modify these two variables to be the width and height of your desired alternates
thumbbox=250
thumbwidth=250
thumbheight=250
coverbox=750
coverwidth=750
coverheight=300
clear
echo Resizing your images and making cover images and thumbnails
for img in `ls *.jpg`
do
name=${img%.*}
ext=${img#*.}
convert -adaptive-resize ${thumbwidth}x${thumbheight}^ -gravity center -crop ${thumbwidth}x${thumbheight}+0+0 $img $name-thumb.$ext
convert -adaptive-resize ${coverbox}x${coverbox} -gravity center -crop ${coverwidth}x${coverheight}+0+0 $img $name-cover.$ext
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment