Tag '/tags/release-4-7-3' created from /trunk:18412
[cyberduck.git] / img / icns.sh
blob872df00e1bf6e5ad9f5f23d1e6ebccd524e326bb
1 # Copyright (c) 2012 David Kocher. All rights reserved.
2 # http://cyberduck.ch/
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # Bug fixes, suggestions and comments should be sent to:
15 # dkocher@cyberduck.ch
17 #!/bin/bash
19 tiff="/usr/bin/tiffutil"
21 usage() {
22 echo "Converts *.png and *@2x.png to .tiff"
23 echo " Usage: combine.sh [--source <png>] --run"
26 run() {
27 for name in `ls . | grep icns`; do
28 png=`basename $name .icns`
29 tiff;
30 done;
33 tiff() {
34 $tiff -cathidpicheck $png.icns -out $png.tiff
37 while [ "$1" != "" ] # When there are arguments...
38 do case "$1" in
39 -r | --run)
40 run;
41 echo "*** DONE. ***";
42 exit 0;
43 ;;
44 -s | --source)
45 shift;
46 png=$1;
47 tiff;
48 echo "*** DONE. ***";
49 exit 0;
50 ;;
51 *)
52 echo "Option [$1] not one of [--run]"; # Error (!)
53 exit 1
54 ;; # Abort Script Now
55 esac;
56 done;
58 usage;