istereo2

diff ios/icons/mkicons @ 3:dc735bdeeb8a

mkicons script added content-scale support for "retina" devices
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 21 Sep 2015 07:40:34 +0300
parents
children 1b7776cb800b
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ios/icons/mkicons	Mon Sep 21 07:40:34 2015 +0300
     1.3 @@ -0,0 +1,95 @@
     1.4 +#!/bin/sh
     1.5 +
     1.6 +srcicon=icon.png
     1.7 +srclaunch=launch.png
     1.8 +
     1.9 +while [ $# -gt 0 ]; do
    1.10 +	case $1 in
    1.11 +	-icon)
    1.12 +		shift
    1.13 +		srcicon=$1
    1.14 +		;;
    1.15 +	-launch)
    1.16 +		shift
    1.17 +		srclaunch=$1
    1.18 +		;;
    1.19 +	*)
    1.20 +		echo "unexpected argument: $1"
    1.21 +		exit 1
    1.22 +		;;
    1.23 +	esac
    1.24 +	shift
    1.25 +done
    1.26 +
    1.27 +if [ ! -f "$srcicon" ]; then
    1.28 +	echo "source icon ($srcicon) missing" >&2
    1.29 +	exit 1
    1.30 +fi
    1.31 +if [ ! -f "$srclaunch" ]; then
    1.32 +	echo "source launch screen ($srclaunch) missing" >&2
    1.33 +	exit 1
    1.34 +fi
    1.35 +
    1.36 +mkicon()
    1.37 +{
    1.38 +	out=$1
    1.39 +	sz=$2
    1.40 +
    1.41 +	echo "$srcicon -> $out (${sz}x${sz})"
    1.42 +	convert $srcicon -resize $sz $out
    1.43 +}
    1.44 +
    1.45 +mklaunch()
    1.46 +{
    1.47 +	out=$1
    1.48 +	xsz=$2
    1.49 +	ysz=$3
    1.50 +
    1.51 +	echo "$srclaunch -> $out (${xsz}x${ysz})"
    1.52 +	convert $srclaunch -resize ${xsz}x${ysz}^ \
    1.53 +		-gravity Center -crop ${xsz}x${ysz}+0+0 +repage \
    1.54 +		$out
    1.55 +}
    1.56 +
    1.57 +echo "Generating icons ..."
    1.58 +# --- iphone spotlight icons
    1.59 +mkicon icon29.png 29	# Icon-Small
    1.60 +mkicon icon58.png 58	# Icon-Small@2x
    1.61 +mkicon icon87.png 87	# Icon-Small@3x
    1.62 +mkicon icon40.png 40	# Icon-Small-40
    1.63 +mkicon icon80.png 80	# Icon-Small-40@2x
    1.64 +mkicon icon120.png 120	# Icon-Small-40@3x
    1.65 +
    1.66 +# --- iphone app icons
    1.67 +mkicon icon57.png 57	# Icon
    1.68 +mkicon icon114.png 114	# Icon@2x
    1.69 +mkicon icon120.png 120	# Icon-60@2x
    1.70 +mkicon icon180.png 180	# Icon-60@3x
    1.71 +
    1.72 +# --- ipad spotlight (40 series plus the following)
    1.73 +mkicon icon50.png 50	# Icon-Small-50
    1.74 +mkicon icon100.png 100	# Icon-Small-50@2x
    1.75 +
    1.76 +# --- ipad app icons
    1.77 +mkicon icon72.png 72	# Icon-72
    1.78 +mkicon icon144.png 144	# Icon-72@2x
    1.79 +mkicon icon76.png 76	# Icon-76
    1.80 +mkicon icon152.png 152	# Icon-76@2x
    1.81 +
    1.82 +echo "Generating launch screens ..."
    1.83 +# iphone portrait launch screen images
    1.84 +mklaunch launch-1242x2208.png 1242 2208
    1.85 +mklaunch launch-750x1334.png 750 1334
    1.86 +mklaunch launch-640x960.png 640 960
    1.87 +mklaunch launch-640x1136.png 640 1136
    1.88 +mklaunch launch-320x480.png 320 480
    1.89 +mklaunch launch-640x960.png 640 960
    1.90 +mklaunch launch-640x1136.png 640 1136
    1.91 +
    1.92 +
    1.93 +# ipad portrait launch screen images
    1.94 +mklaunch launch-768x1024.png 768 1024
    1.95 +mklaunch launch-1536x2048.png 1536 2048
    1.96 +mklaunch launch-768x1004.png 768 1004
    1.97 +mklaunch launch-1536x2008.png 1536 2008
    1.98 +