annotate lib-src/tm-image @ 371:cc15677e0335 r21-2b1

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