Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #crops all images to a square
- #set output size
- size="300"
- for i in ../imgs/*;
- do
- #get longest side
- s="$(identify -format "%[fx:min(w,h)]x%[fx:min(w,h)]+0+0" $i)"
- convert $i -gravity center -crop $s -resize $size "$(basename $i)"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement