-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappicon
executable file
·86 lines (64 loc) · 1.82 KB
/
appicon
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
GREEN='\033[0;32m'
NC='\033[0m'
start(){
ORIGINAL_FILE=$1
NUM=0
DESTINATION_FOLDER="app_icon"
while [ -d $DESTINATION_FOLDER ]
do
NUM=$(($NUM+1))
DESTINATION_FOLDER="app_icon_$NUM"
done
IOS_FOLDER="$DESTINATION_FOLDER/ios"
ANDROID_FOLDER="$DESTINATION_FOLDER/android"
mkdir $DESTINATION_FOLDER
mkdir $IOS_FOLDER
mkdir $ANDROID_FOLDER
if [ -f $ORIGINAL_FILE ]; then
echo -e "${GREEN}Resize > $ORIGINAL_FILE${NC}"
#=====IOS
resize_iOS_AppStoreArtwork
resize_iOS 20 icon20pt.png
resize_iOS 40 [email protected]
resize_iOS 60 [email protected]
resize_iOS 29 icon29pt.png
resize_iOS 58 [email protected]
resize_iOS 87 [email protected]
resize_iOS 40 icon40pt.png
resize_iOS 80 [email protected]
resize_iOS 120 [email protected]
resize_iOS 120 [email protected]
resize_iOS 180 [email protected]
resize_iOS 180 [email protected]
resize_iOS 76 icon76pt.png
resize_iOS 152 [email protected]
resize_iOS 167 [email protected]
#===ANDROID
resize_Android 512 playStore
resize_Android 48 mipmap-mdpi
resize_Android 72 mipmap-hdpi
resize_Android 96 mipmap-xhdpi
resize_Android 144 mipmap-xxhdpi
resize_Android 192 mipmap-xxxhdpi
else
echo "$ORIGINAL_FILE not exist."
fi
}
resize_iOS(){
DESTINATION_FILE="$IOS_FOLDER/$2"
sips -s format png -Z $1 $ORIGINAL_FILE --out $DESTINATION_FILE > /dev/null
echo -e $DESTINATION_FILE ${GREEN}Done.${NC}
}
resize_iOS_AppStoreArtwork(){
DESTINATION_FILE="$IOS_FOLDER/AppStoreIcon.jpg"
sips -s format jpeg -Z 1024 $ORIGINAL_FILE --out $DESTINATION_FILE > /dev/null
echo -e $DESTINATION_FILE ${GREEN}Done.${NC}
}
resize_Android(){
mkdir "$ANDROID_FOLDER/$2"
DESTINATION_FILE="$ANDROID_FOLDER/$2/ic_launcher.png"
sips -s format png -Z $1 $ORIGINAL_FILE --out $DESTINATION_FILE > /dev/null
echo -e $DESTINATION_FILE ${GREEN}Done.${NC}
}
start $1