-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_icons.sh
39 lines (32 loc) · 939 Bytes
/
generate_icons.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
#!/bin/sh
#
# Copyright (C) 2018 daisuke-t
#
# Make android icon(ic_launcher.png) on Mac OS.
#
# Arguments:
# $1 - source image
#
# Note:
# Source image is PNG 24 format.
set -e
# check args.
if [ $# -ne 1 ]; then
echo "invalid argument."
echo $#
exit
fi
SRC_FILE=$1
OUT_DIR=android_res
# prepare build folder.
mkdir -p $OUT_DIR/mipmap-mdpi
mkdir -p $OUT_DIR/mipmap-hdpi
mkdir -p $OUT_DIR/mipmap-xhdpi
mkdir -p $OUT_DIR/mipmap-xxhdpi
mkdir -p $OUT_DIR/mipmap-xxxhdpi
# make icon.
convert -limit time 2000 -scale 48x48 ${SRC_FILE} $OUT_DIR/mipmap-mdpi/ic_launcher.png
convert -limit time 2000 -scale 72x72 ${SRC_FILE} $OUT_DIR/mipmap-hdpi/ic_launcher.png
convert -limit time 2000 -scale 96x96 ${SRC_FILE} $OUT_DIR/mipmap-xhdpi/ic_launcher.png
convert -limit time 2000 -scale 144x144 ${SRC_FILE} $OUT_DIR/mipmap-xxhdpi/ic_launcher.png
convert -limit time 2000 -scale 192x192 ${SRC_FILE} $OUT_DIR/mipmap-xxxhdpi/ic_launcher.png