Graphics rearrangement and probably breakage.
[dcpomatic.git] / graphics / update
1 #!/bin/bash
2 #
3 # Update generated stuff in graphics/ from the source files.
4 #
5 # It would be nice to do this with waf but:
6 # a) getting the wscript right is a complete pain in the arse
7 # b) running Inkscape from the command line on OS X is a complete pain in the arse
8
9 pwd=`pwd`
10 if [ `basename $pwd` != "graphics" ]; then
11   echo "$0: run within graphics/"
12   exit 1
13 fi
14
15 if [ `uname -s` == "Darwin" ]; then
16     # Convert OS X icons using OS X-only iconutil
17     iconutil --convert icns --output dcpomatic.icns dcpomatic.iconset
18 else
19     INKSCAPE="inkscape -z -C -e"
20
21     # OS X application icons
22     mkdir -p dcpomatic.iconset
23     for r in 16 32 128 256 512; do
24         $INKSCAPE dcpomatic.iconset/icon_$rx$r.png dcpomatic2.svg -w $r -h $r dcpomatic2.svg
25         $INKSCAPE dcpomatic.iconset/icon_$rx$r@2x.png -w $r -h $r dcpomatic2.svg 
26     done
27
28     # Linux application icons
29     for r in 16 22 32 48 64 128 256 512; do
30         mkdir -p $r
31         for p in dcpomatic2 dcpomatic2_kdm dcpomatic2_server dcpomatic2_batch; do
32             $INKSCAPE $r/$p.png $p.svg -w $r -h $r 
33         done
34     done
35     
36     # Windows application icons
37     for p in dcpomatic2 dcpomatic2_kdm dcpomatic2_server dcpomatic2_batch; do
38         icotool -c -o $p.ico 48/$p.png
39     done
40     icotool -c -o dcpomatic2_server_small.ico dcpomatic2_server_small.png
41     $INKSCAPE dcpomatic.png dcpomatic2.svg -w 400 -h 286
42     convert dcpomatic.png dcpomatic.bmp
43     
44     # Preferences icons (all platforms)
45     # servers.png does not have an SVG version
46     for i in colour_conversions defaults kdm_email keys tms; do
47         $INKSCAPE $i.png $i.svg -w 32 -h 32
48     done
49
50     # Splash screen (all platforms)
51     $INKSCAPE splash.png splash.svg -w 400 -h 300
52 fi