|
@@ -120,7 +120,23 @@ function set_avatar_from_url {
|
120
|
120
|
|
121
|
121
|
# download the image
|
122
|
122
|
cd $BASE_DIR/customimages
|
123
|
|
- wget $AVATAR -O avatar.png
|
|
123
|
+ # convert to png
|
|
124
|
+ wget $AVATAR -O avatar
|
|
125
|
+ if [[ $AVATAR == *".gif" ]]; then
|
|
126
|
+ mogrify -format png avatar
|
|
127
|
+ fi
|
|
128
|
+ if [[ $AVATAR == *".jpg" ]]; then
|
|
129
|
+ mogrify -format png avatar
|
|
130
|
+ fi
|
|
131
|
+ if [[ $AVATAR == *".jpeg" ]]; then
|
|
132
|
+ mogrify -format png avatar
|
|
133
|
+ fi
|
|
134
|
+ if [[ $AVATAR != *".png" ]]; then
|
|
135
|
+ mv avatar avatar.png
|
|
136
|
+ fi
|
|
137
|
+
|
|
138
|
+ # standard size
|
|
139
|
+ mogrify -resize 150x150 avatar.png
|
124
|
140
|
if [ ! -f $BASE_DIR/customimages/avatar.png ]; then
|
125
|
141
|
echo $'Avatar image could not be downloaded'
|
126
|
142
|
exit 3
|