Created
July 3, 2015 18:11
-
-
Save ynakajima/befe14ee469b78cf8d1c to your computer and use it in GitHub Desktop.
サイズと余白色を指定してサムネイル画像をつくるシェルスクリプト(require ImageMagick)
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 | |
src=$1 | |
dist=$2 | |
width=$3 | |
height=$4 | |
bgcolor=$5 | |
if [ $# -lt 5 ]; then | |
echo "error: invalid argments" | |
echo "usage: $0 src dist width height bgcolor" | |
exit 1 | |
fi | |
convert $src -thumbnail ${width}x${height} -background ${bgcolor} \ | |
-gravity center -extent ${width}x${height} \ | |
$dist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment