Skip to content

Instantly share code, notes, and snippets.

@ynakajima
Created July 3, 2015 18:11
Show Gist options
  • Save ynakajima/befe14ee469b78cf8d1c to your computer and use it in GitHub Desktop.
Save ynakajima/befe14ee469b78cf8d1c to your computer and use it in GitHub Desktop.
サイズと余白色を指定してサムネイル画像をつくるシェルスクリプト(require ImageMagick)
#!/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