forked from luckypool/iOS-Default-Images-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerator.sh
executable file
·71 lines (59 loc) · 2.27 KB
/
generator.sh
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
#!/bin/bash
# Usage
# -------------------------------------------
usage() { echo "usage: $0 src_image bg_color [dst_dir]"; exit 1; }
[ "$1" ] && [ "$2" ] || usage
[ "$3" ] || set "$1" "$2" "./dst"
# Directories
# -------------------------------------------
ICONDIR=$3/icon
SCREENDIR=$3/screen
eval mkdir -p "$ICONDIR"
eval mkdir -p "$SCREENDIR"
# Show progress
# -------------------------------------------
set -x
# App Icons
# -------------------------------------------
c="convert -background none"
# iPhone iOS 5/6
$c "$1" -resize 57x57 "$ICONDIR/Icon.png"
$c "$1" -resize 114x114 "$ICONDIR/[email protected]"
# iPad iOS 5/6
$c "$1" -resize 72x72 "$ICONDIR/Icon-72.png"
$c "$1" -resize 144x144 "$ICONDIR/[email protected]"
# iPhone iOS7
$c "$1" -resize 60x60 "$ICONDIR/Icon-60.png"
$c "$1" -resize 120x120 "$ICONDIR/[email protected]"
$c "$1" -resize 180x180 "$ICONDIR/[email protected]"
# iPad iOS7
$c "$1" -resize 76x76 "$ICONDIR/Icon-76.png"
$c "$1" -resize 152x152 "$ICONDIR/[email protected]"
# iPad Pro
$c "$1" -resize 167x167 "$ICONDIR/[email protected]"
# Setting
$c "$1" -resize 29x29 "$ICONDIR/Icon-Small-29.png"
$c "$1" -resize 58x58 "$ICONDIR/[email protected]"
$c "$1" -resize 87x87 "$ICONDIR/[email protected]"
# Spotlight
$c "$1" -resize 40x40 "$ICONDIR/Icon-Small-40.png"
$c "$1" -resize 80x80 "$ICONDIR/[email protected]"
$c "$1" -resize 120x120 "$ICONDIR/[email protected]"
# 50
$c "$1" -resize 50x50 "$ICONDIR/Icon-Small-50.png"
$c "$1" -resize 100x100 "$ICONDIR/[email protected]"
# AppStore
$c "$1" -resize 512x512 "$ICONDIR/iTunesArtwork.png"
$c "$1" -resize 1024x1024 "$ICONDIR/[email protected]"
# App Launch Images
# -------------------------------------------
c="convert $1 -background $2 -gravity center"
# iPhone
$c -resize 256x256 -extent 320x480 "$SCREENDIR/Default~iphone.png"
$c -resize 512x512 -extent 640x960 "$SCREENDIR/Default@2x~iphone.png"
$c -resize 512x512 -extent 640x1136 "$SCREENDIR/Default-568h@2x~iphone.png"
# iPad
$c -resize 512x512 -extent 768x1024 "$SCREENDIR/Default-Portrait~ipad.png"
$c -resize 1024x1024 -extent 1536x2048 "$SCREENDIR/Default-Portrait@2x~ipad.png"
$c -resize 512x512 -extent 1024x768 "$SCREENDIR/Default-Landscape~ipad.png"
$c -resize 1024x1024 -extent 2048x1536 "$SCREENDIR/Default-Landscape@2x~ipad.png"