Attach source and documentation.
[cyberduck.git] / img / combine.sh
blob01f95922a450841dd1ad9f81c88b677bd919db69
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 @2x.png`; do
28 png=`basename $name @2x.png`
29 tiff;
30 done;
33 tiff() {
34 echo "$tiff -cathidpicheck $png.png $png@2x.png -out $png.tiff"
35 $tiff -cathidpicheck $png.png $png@2x.png -out $png.tiff
38 while [ "$1" != "" ] # When there are arguments...
39 do case "$1" in
40 -r | --run)
41 run;
42 echo "*** DONE. ***";
43 exit 0;
44 ;;
45 -s | --source)
46 shift;
47 png=$1;
48 tiff;
49 echo "*** DONE. ***";
50 exit 0;
51 ;;
52 *)
53 echo "Option [$1] not one of [--run]"; # Error (!)
54 exit 1
55 ;; # Abort Script Now
56 esac;
57 done;
59 usage;