6 CONVERT
=${CONVERT:-convert}
7 COMPOSITE
=${COMPOSITE:-composite}
8 INKSCAPE
=${INKSCAPE:-inkscape}
9 PPMTOWINICON
=${PPMTOWINICON:-ppmtowinicon}
18 $0 -- Regenerate desktop icon files and windows icon files
22 --help Displays this message and exits
24 --skip-png Skips the regeneration of the .png file(s)
26 --skip-winicon Skips the regneration of the Windows icon file(s)
32 while test $# -ne 0 ; do
51 echo "$0: Unknown option $1"
62 if test $?
-ne 0 ; then
68 ## Export the SVG graphics
71 # see if we have inkscape
72 if test $do_inkscape = yes ; then
73 ${INKSCAPE} --version 2>&1 >/dev
/null
74 if test $?
-ne 0 ; then
75 echo "\"${INKSCAPE} --version\" failed."
76 echo "Make sure that inkscape is installed and functional on your system."
77 echo "Skipping the SVG -> PNG conversion."
82 if test $do_inkscape = yes ; then
83 echo "Export SVG graphics to png..."
85 for r
in 16 22 24 32 48 ; do
98 for f
in *-${rs}.svg
; do
99 fb
=`basename ${f} ${rs}.svg`
102 ${INKSCAPE} --export-png=${p} --export-area=${x}:${x}:${y}:${y} ${f}
108 ## Generate the windows icon file
113 if test $do_convert = yes ; then
114 # see if we have ImageMagick
115 ${CONVERT} --version 2>&1 >/dev
/null
116 if test $?
-ne 0 ; then
117 echo "\"${CONVERT} --version\" failed."
118 echo "Make sure that ImageMagick is installed and functional on your system."
119 echo "Skipping the PNG -> PPM conversion."
124 if test $do_convert = yes ; then
125 echo "Creating windows pbm mask files..."
126 ${CONVERT} -channel matte
-separate +matte
${app_icon}-48.png
- |
127 ${CONVERT} -threshold 65534 -negate - 48_mask.pbm
128 ${CONVERT} -channel matte
-separate +matte
${app_icon}-32.png
- |
129 ${CONVERT} -threshold 65534 -negate - 32_mask.pbm
130 ${CONVERT} -channel matte
-separate +matte
${app_icon}-16.png
- |
131 ${CONVERT} -threshold 65534 -negate - 16_mask.pbm
133 echo "Creating windows ppm flattened files..."
134 ${CONVERT} -flatten -colors 16 ${app_icon}-48.png
48_16.ppm
135 ${CONVERT} -flatten -colors 256 ${app_icon}-48.png
48_256.ppm
136 ${CONVERT} -flatten -colors 16 ${app_icon}-32.png
32_16.ppm
137 ${CONVERT} -flatten -colors 256 ${app_icon}-32.png
32_256.ppm
138 ${CONVERT} -flatten -colors 16 ${app_icon}-16.png
16_16.ppm
139 ${CONVERT} -flatten -colors 256 ${app_icon}-16.png
16_256.ppm
142 # see if we have netpbm
143 if test $do_winicon = yes ; then
144 ${PPMTOWINICON} --version 2>&1 >/dev
/null
145 if test $?
-ne 0 ; then
146 echo "\"${PPMTOWINICON} --version\" failed."
147 echo "Make sure that netpbm is installed and functional on your system."
148 echo "Skipping the pbm -> windows icon conversion."
153 if test $do_winicon = yes ; then
154 echo "Creating windows icon file..."
155 ${PPMTOWINICON} -output gerbv_icon.ico
-andpgms\
156 48_16.ppm
48_mask.pbm
48_256.ppm
48_mask.pbm\
157 32_16.ppm
32_mask.pbm
32_256.ppm
32_mask.pbm\
158 16_16.ppm
16_mask.pbm
16_256.ppm
16_mask.pbm
162 48_16.ppm
48_256.ppm
48_mask.pbm\
163 32_16.ppm
32_256.ppm
32_mask.pbm\
164 16_16.ppm
16_256.ppm
16_mask.pbm