Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- : '
- Requirements:
- $ brew install imagemagick
- Usage:
- $ ./icon-tool iconPath destination
- Where:
- * iconpath: the path of the icon you will use as source, it has be 1024 x 1024. Defaults to: ../skin/res/ios/icon.png
- * destination: the folder where you want to output the icon. Defaults to: ../skin/res/ios/icons
- - Android ouput:
- Not available yet, it will be generated by Android studio for now.
- - iOS output:
- <icon src="res/ios/icons/[email protected]" width="20" height="20" />
- <icon src="res/ios/icons/[email protected]" width="40" height="40" />
- <icon src="res/ios/icons/[email protected]" width="60" height="60" />
- <icon src="res/ios/icons/[email protected]" width="29" height="29" />
- <icon src="res/ios/icons/[email protected]" width="58" height="58" />
- <icon src="res/ios/icons/[email protected]" width="87" height="87" />
- <icon src="res/ios/icons/[email protected]" width="40" height="40" />
- <icon src="res/ios/icons/[email protected]" width="80" height="80" />
- <icon src="res/ios/icons/[email protected]" width="120" height="120" />
- <icon src="res/ios/icons/[email protected]" width="57" height="57" />
- <icon src="res/ios/icons/[email protected]" width="114" height="114" />
- <icon src="res/ios/icons/[email protected]" width="60" height="60" />
- <icon src="res/ios/icons/[email protected]" width="120" height="120" />
- <icon src="res/ios/icons/[email protected]" width="180" height="180" />
- <icon src="res/ios/icons/[email protected]" width="72" height="72" />
- <icon src="res/ios/icons/[email protected]" width="144" height="144" />
- <icon src="res/ios/icons/[email protected]" width="76" height="76" />
- <icon src="res/ios/icons/[email protected]" width="152" height="152" />
- <icon src="res/ios/icons/[email protected]" width="228" height="228" />
- <icon src="res/ios/icons/[email protected]" width="167" height="167" />
- <icon src="res/ios/icons/[email protected]" width="50" height="50" />
- <icon src="res/ios/icons/[email protected]" width="100" height="100" />
- <icon src="res/ios/icons/[email protected]" width="48" height="48" />
- <icon src="res/ios/icons/[email protected]" width="55" height="55" />
- <icon src="res/ios/icons/[email protected]" width="88" height="88" />
- <icon src="res/ios/icons/[email protected]" width="172" height="172" />
- <icon src="res/ios/icons/[email protected]" width="196" height="196" />
- <icon src="res/ios/icons/[email protected]" width="1024" height="1024" />
- '
- sizes="20x1 20x2 20x3 24x2 27.5x2 29x1 29x2 29x3 40x1 40x2 40x3 44x2 50x1 50x2 57x1 57x2 60x1 60x2 60x3 72x1 72x2 76x1 76x2 76x3 83.5x2 86x2 98x2 1024x1"
- source=${1:-"../skin/res/ios/icon.png"}
- dst=${2:-"../skin/res/ios/icons"}
- for s in $sizes;do
- size=${s%x*}
- scale=${s##*x}
- resize=$(bc <<< ${size}*${scale} )
- generatedIcon=$dst/"Icon-App-${size}x${size}@${scale}x.png"
- convert "$source" -resize ${resize}x${resize} $generatedIcon
- if [ -f $generatedIcon ];
- then
- echo "Created: $generatedIcon"
- else
- echo "Could not create $generatedIcon"
- fi
- done
Add Comment
Please, Sign In to add comment