istereo2

annotate ios/icons/mkicons @ 30:900651a2f401

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 08 Oct 2015 06:54:18 +0300
parents dc735bdeeb8a
children
rev   line source
nuclear@3 1 #!/bin/sh
nuclear@3 2
nuclear@3 3 srcicon=icon.png
nuclear@3 4 srclaunch=launch.png
nuclear@3 5
nuclear@3 6 while [ $# -gt 0 ]; do
nuclear@3 7 case $1 in
nuclear@3 8 -icon)
nuclear@3 9 shift
nuclear@3 10 srcicon=$1
nuclear@3 11 ;;
nuclear@3 12 -launch)
nuclear@3 13 shift
nuclear@3 14 srclaunch=$1
nuclear@3 15 ;;
nuclear@3 16 *)
nuclear@3 17 echo "unexpected argument: $1"
nuclear@3 18 exit 1
nuclear@3 19 ;;
nuclear@3 20 esac
nuclear@3 21 shift
nuclear@3 22 done
nuclear@3 23
nuclear@3 24 if [ ! -f "$srcicon" ]; then
nuclear@3 25 echo "source icon ($srcicon) missing" >&2
nuclear@3 26 exit 1
nuclear@3 27 fi
nuclear@3 28 if [ ! -f "$srclaunch" ]; then
nuclear@3 29 echo "source launch screen ($srclaunch) missing" >&2
nuclear@3 30 exit 1
nuclear@3 31 fi
nuclear@3 32
nuclear@3 33 mkicon()
nuclear@3 34 {
nuclear@3 35 out=$1
nuclear@3 36 sz=$2
nuclear@3 37
nuclear@3 38 echo "$srcicon -> $out (${sz}x${sz})"
nuclear@3 39 convert $srcicon -resize $sz $out
nuclear@3 40 }
nuclear@3 41
nuclear@3 42 mklaunch()
nuclear@3 43 {
nuclear@3 44 out=$1
nuclear@3 45 xsz=$2
nuclear@3 46 ysz=$3
nuclear@3 47
nuclear@3 48 echo "$srclaunch -> $out (${xsz}x${ysz})"
nuclear@3 49 convert $srclaunch -resize ${xsz}x${ysz}^ \
nuclear@3 50 -gravity Center -crop ${xsz}x${ysz}+0+0 +repage \
nuclear@3 51 $out
nuclear@16 52
nuclear@16 53 echo "rotating for landscape-$out (${ysz}x${xsz})"
nuclear@16 54 convert $out -rotate 90 landscape-$out
nuclear@3 55 }
nuclear@3 56
nuclear@3 57 echo "Generating icons ..."
nuclear@3 58 # --- iphone spotlight icons
nuclear@3 59 mkicon icon29.png 29 # Icon-Small
nuclear@3 60 mkicon icon58.png 58 # Icon-Small@2x
nuclear@3 61 mkicon icon87.png 87 # Icon-Small@3x
nuclear@3 62 mkicon icon40.png 40 # Icon-Small-40
nuclear@3 63 mkicon icon80.png 80 # Icon-Small-40@2x
nuclear@3 64 mkicon icon120.png 120 # Icon-Small-40@3x
nuclear@3 65
nuclear@3 66 # --- iphone app icons
nuclear@3 67 mkicon icon57.png 57 # Icon
nuclear@3 68 mkicon icon114.png 114 # Icon@2x
nuclear@3 69 mkicon icon120.png 120 # Icon-60@2x
nuclear@3 70 mkicon icon180.png 180 # Icon-60@3x
nuclear@3 71
nuclear@3 72 # --- ipad spotlight (40 series plus the following)
nuclear@3 73 mkicon icon50.png 50 # Icon-Small-50
nuclear@3 74 mkicon icon100.png 100 # Icon-Small-50@2x
nuclear@3 75
nuclear@3 76 # --- ipad app icons
nuclear@3 77 mkicon icon72.png 72 # Icon-72
nuclear@3 78 mkicon icon144.png 144 # Icon-72@2x
nuclear@3 79 mkicon icon76.png 76 # Icon-76
nuclear@3 80 mkicon icon152.png 152 # Icon-76@2x
nuclear@3 81
nuclear@3 82 echo "Generating launch screens ..."
nuclear@3 83 # iphone portrait launch screen images
nuclear@3 84 mklaunch launch-1242x2208.png 1242 2208
nuclear@3 85 mklaunch launch-750x1334.png 750 1334
nuclear@3 86 mklaunch launch-640x960.png 640 960
nuclear@3 87 mklaunch launch-640x1136.png 640 1136
nuclear@3 88 mklaunch launch-320x480.png 320 480
nuclear@3 89 mklaunch launch-640x960.png 640 960
nuclear@3 90 mklaunch launch-640x1136.png 640 1136
nuclear@3 91
nuclear@3 92
nuclear@3 93 # ipad portrait launch screen images
nuclear@3 94 mklaunch launch-768x1024.png 768 1024
nuclear@3 95 mklaunch launch-1536x2048.png 1536 2048
nuclear@3 96 mklaunch launch-768x1004.png 768 1004
nuclear@3 97 mklaunch launch-1536x2008.png 1536 2008
nuclear@3 98