-
-
Save tygor/4392411 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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