-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedxapp-icon.generator.sh
executable file
·66 lines (54 loc) · 1.75 KB
/
edxapp-icon.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
#!/bin/bash
set -e
SOURCE_FILE="$1"
TARGET_DIR="$2"
edXius () {
local blue="\033[1;34m"
local normal="\033[0m"
echo -e "[${blue}edXius${normal}] $1"
}
run() {
cat << EOF
USAGE:
$0 SOURCEFILE TARGETDIR
EOF
}
# Check if ImageMagick installed, if not then brew install ImageMagick
command -v convert >/dev/null 2>&1 && {
echo "Tools are ready...."
} || {
echo "Installing ImageMagick"
brew install ImageMagick
}
# Check parameter
if [ $# != 2 ];then
run
exit -1
fi
# Check Target directory, if not mkdir
if [ ! -d "$TARGET_DIR" ];then
mkdir -p "$TARGET_DIR"
fi
edXius 'Generate iTunesArtwork.png...'
convert "$SOURCE_FILE" -resize 512x512 "$TARGET_DIR/iTunesArtwork.png"
edXius 'Generate [email protected] ...'
convert "$SOURCE_FILE" -resize 1024x1024 "$TARGET_DIR/[email protected]"
edXius 'Generate Icon-29.png ...'
convert "$SOURCE_FILE" -resize 29x29 "$TARGET_DIR/Icon-29.png"
edXius 'Generate [email protected] ...'
convert "$SOURCE_FILE" -resize 58x58 "$TARGET_DIR/[email protected]"
edXius 'Generate [email protected] ...'
convert "$SOURCE_FILE" -resize 87x87 "$TARGET_DIR/[email protected]"
edXius 'Generate Icon-40.png ...'
convert "$SOURCE_FILE" -resize 40x40 "$TARGET_DIR/Icon-40.png"
edXius 'Generate [email protected] ...'
convert "$SOURCE_FILE" -resize 80x80 "$TARGET_DIR/[email protected]"
edXius 'Generate [email protected] ...'
convert "$SOURCE_FILE" -resize 120x120 "$TARGET_DIR/[email protected]"
edXius 'Generate Icon-60.png ...'
convert "$SOURCE_FILE" -resize 60x60 "$TARGET_DIR/Icon-60.png"
edXius 'Generate [email protected] ...'
convert "$SOURCE_FILE" -resize 120x120 "$TARGET_DIR/[email protected]"
edXius 'Generate [email protected] ...'
convert "$SOURCE_FILE" -resize 180x180 "$TARGET_DIR/[email protected]"
edXius 'Icon is ready Darth edXius'