blog image is a standard size

This commit is contained in:
Bob Mottram 2016-03-23 15:42:46 +00:00
parent b22631766d
commit 10c2e13c61
2 changed files with 20 additions and 1 deletions

View File

@ -7750,6 +7750,9 @@ function install_blog {
return
fi
# for the avatar changing command
apt-get -y install imagemagick
if [ ! -d /var/www/$FULLBLOG_DOMAIN_NAME ]; then
mkdir /var/www/$FULLBLOG_DOMAIN_NAME
fi

View File

@ -120,7 +120,23 @@ function set_avatar_from_url {
# download the image
cd $BASE_DIR/customimages
wget $AVATAR -O avatar.png
# convert to png
wget $AVATAR -O avatar
if [[ $AVATAR == *".gif" ]]; then
mogrify -format png avatar
fi
if [[ $AVATAR == *".jpg" ]]; then
mogrify -format png avatar
fi
if [[ $AVATAR == *".jpeg" ]]; then
mogrify -format png avatar
fi
if [[ $AVATAR != *".png" ]]; then
mv avatar avatar.png
fi
# standard size
mogrify -resize 150x150 avatar.png
if [ ! -f $BASE_DIR/customimages/avatar.png ]; then
echo $'Avatar image could not be downloaded'
exit 3