Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # mkthumbs
- #
- # Receives a filelist on STDIN and converts each to desired geometry
- # Requires GraphicsMagick
- #
- # Will probably work with ImageMagick by simply removing the "gm " from "gm convert"
- echo "USAGE: filelist | mkthumbs 200x150"
- GEOMETRY="$1"
- while read -r line
- do
- NEWNAME=${line/\.jpg/"-$GEOMETRY.jpg"}
- echo "Converting $line to $NEWNAME"
- gm convert "$line" -geometry "$GEOMETRY^" -gravity Center -crop "$GEOMETRY+0+0" -quality 90 "$NEWNAME"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement