diff --git a/src/freedombone b/src/freedombone index df9804b2..414477e7 100755 --- a/src/freedombone +++ b/src/freedombone @@ -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 diff --git a/src/freedombone-blog b/src/freedombone-blog index 7936f0d8..bb02d8d5 100755 --- a/src/freedombone-blog +++ b/src/freedombone-blog @@ -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