annotate lib-src/tm-image @ 10:49a24b4fd526 r19-15b6

Import from CVS: tag r19-15b6
author cvs
date Mon, 13 Aug 2007 08:47:52 +0200
parents b82b59fe008d
children 0293115a14e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1 #!/bin/sh -
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
2 #
10
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
3 # $Id: tm-image,v 1.2 1996/12/29 00:14:55 steve Exp $
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
4 #
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
5 # Copyright 1994, 1995, 1996 Free Software Foundation, Inc.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
6
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
7 # This program is free software; you can redistribute it and/or modify
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
8 # it under the terms of the GNU General Public License as published by
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
9 # the Free Software Foundation; either version 2, or (at your option)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
10 # any later version.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
11 #
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
12 # This program is distributed in the hope that it will be useful,
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
15 # GNU General Public License for more details.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
16 #
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
17 # You should have received a copy of the GNU General Public License
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
18 # along with GNU Emacs; see the file COPYING. If not, write to the
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
19 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
20 # Boston, MA 02111-1307, USA.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
21
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
22 if [ "$TM_TMP_DIR" = "" ]; then
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
23 TM_TMP_DIR=/tmp
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
24 export TM_TMP_DIR
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
25 fi
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
26 if [ "$5" = "" ]; then
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
27 case "$2" in
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
28 "image/gif")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
29 filename="$TM_TMP_DIR/mime$$.gif"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
30 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
31 "image/jpeg")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
32 filename="$TM_TMP_DIR/mime$$.jpg"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
33 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
34 "image/tiff"|"image/x-tiff")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
35 filename="$TM_TMP_DIR/mime$$.tif"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
36 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
37 "image/x-xwd")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
38 filename="$TM_TMP_DIR/mime$$.xwd"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
39 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
40 "image/x-xbm")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
41 filename="$TM_TMP_DIR/mime$$.xbm"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
42 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
43 "image/x-pic")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
44 filename="$TM_TMP_DIR/mime$$.pic"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
45 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
46 "image/x-mag")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
47 filename="$TM_TMP_DIR/mime$$.mag"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
48 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
49 *)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
50 filename="$TM_TMP_DIR/mime$$.img"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
51 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
52 esac
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
53 else
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
54 filename="$TM_TMP_DIR/$5"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
55 fi
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
56
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
57 echo "$2; $3 -> $filename"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
58
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
59 tmdecode $3 $1 $filename
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
60
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
61 case "$4" in
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
62 "play")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
63 xv -geometry +1+1 $filename
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
64 trap 'rm -f $filename' 0 1 2 3 13 15
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
65 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
66 "extract")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
67 echo "extract to $filename"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
68 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
69 esac