Ver código fonte

blog image is a standard size

Bob Mottram 9 anos atrás
pai
commit
10c2e13c61
2 arquivos alterados com 20 adições e 1 exclusões
  1. 3
    0
      src/freedombone
  2. 17
    1
      src/freedombone-blog

+ 3
- 0
src/freedombone Ver arquivo

7750
         return
7750
         return
7751
     fi
7751
     fi
7752
 
7752
 
7753
+    # for the avatar changing command
7754
+    apt-get -y install imagemagick
7755
+
7753
     if [ ! -d /var/www/$FULLBLOG_DOMAIN_NAME ]; then
7756
     if [ ! -d /var/www/$FULLBLOG_DOMAIN_NAME ]; then
7754
         mkdir /var/www/$FULLBLOG_DOMAIN_NAME
7757
         mkdir /var/www/$FULLBLOG_DOMAIN_NAME
7755
     fi
7758
     fi

+ 17
- 1
src/freedombone-blog Ver arquivo

120
 
120
 
121
     # download the image
121
     # download the image
122
     cd $BASE_DIR/customimages
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
     if [ ! -f $BASE_DIR/customimages/avatar.png ]; then
140
     if [ ! -f $BASE_DIR/customimages/avatar.png ]; then
125
         echo $'Avatar image could not be downloaded'
141
         echo $'Avatar image could not be downloaded'
126
         exit 3
142
         exit 3