-
Notifications
You must be signed in to change notification settings - Fork 0
/
makeTiIcons.bash
executable file
·55 lines (46 loc) · 1.79 KB
/
makeTiIcons.bash
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
#!/bin/bash
# Convert a source image file to the various icon size by resizing
# For alloy apps
PREFIX="app/assets"
# For non-alloy apps
#PREFIX="Resources"
usage ()
{
echo $0 [source icon 512x512]
}
if [ ! -f "$1" ]; then
echo "A source image has not been specified"
usage
exit 2
fi
if [ ! -d "$PREFIX" ]; then
echo "The directory structure to create the files in does not exist. Maybe this is not the root of an Appclerator project"
usage
exit 1
fi
# iOS app icons
echo "Making the iOS icon images"
# Input should be the 512 icon
convert "$1" -resize 512x512 $PREFIX/iphone/iTunesArtwork
#convert "$1" -resize 512x512 $PREFIX/iphone/[email protected]
convert "$1" -resize 114x114 $PREFIX/iphone/[email protected]
convert "$1" -resize 72x72 $PREFIX/iphone/appicon-72.png
convert "$1" -resize 144x144 $PREFIX/iphone/[email protected]
convert "$1" -resize 57x57 $PREFIX/iphone/appicon.png
convert "$1" -resize 50x50 $PREFIX/iphone/appicon-Small-50.png
convert "$1" -resize 100x100 $PREFIX/iphone/[email protected]
convert "$1" -resize 29x29 $PREFIX/iphone/appicon-Small.png
convert "$1" -resize 58x58 $PREFIX/iphone/[email protected]
# new iOS 7 icons
echo "Making the iOS 7 icon images"
convert "$1" -resize 40x40 $PREFIX/iphone/appicon-Small-40.png
convert "$1" -resize 80x80 $PREFIX/iphone/[email protected]
convert "$1" -resize 120x120 $PREFIX/iphone/[email protected]
convert "$1" -resize 76x76 $PREFIX/iphone/appicon-76.png
convert "$1" -resize 152x152 $PREFIX/iphone/[email protected]
# Android
echo "Making the Android icon images"
convert -size 128x128 xc:none -fill white -draw 'roundRectangle 0,0 128,128 10,10' "$1"[128x128] -compose SrcIn -composite $PREFIX/android/appicon.png
# mobile web
echo "Making the mobileweb images"
convert "$1" -resize 128x128 $PREFIX/mobileweb/appicon.png