ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/mports/trunk/mail/faces/files/xbmsize48
Revision: 16349
Committed: Sun Apr 20 18:32:36 2014 UTC (9 years, 11 months ago) by laffer1
File size: 1326 byte(s)
Log Message:
remove cvs2svn:cvs-rev prop

File Contents

# Content
1 #!/bin/sh
2 #
3 # @(#)xbmsize48 1.3 91/11/19
4 #
5 # Copyright (c) Steve Kinzler - April 1991.
6 #
7 # Permission is given to distribute these sources, as long as the
8 # copyright messages are not removed, and no monies are exchanged.
9 #
10 # No responsibility is taken for any errors on inaccuracies inherent
11 # either to the comments or the code of this program, but if reported
12 # to me, then an attempt will be made to fix them.
13
14 PATH=$PATH:/usr/bin/X11; export PATH
15
16 size=48
17
18 # xbmsize48 - size an X11 bitmap to 48x48
19 #
20 # If the bitmaps exceeds 48 pixels in either dimension it is scaled down
21 # to 48 pixels. Then, the bitmap is pasted into the upper left corner of
22 # a 48x48 blank bitmap.
23 #
24 # A stdin/stdout filter.
25 # Requires filters from the pbmplus package.
26 #
27 # Steve Kinzler, kinzler@cs.indiana.edu, March 1991
28
29 tmp=/tmp/xbmsize48.$$
30 tmp2=/tmp/xbmsize48.2.$$
31 trap "rm -f $tmp $tmp2; exit" 0 1 2 13 15
32
33 cat > $tmp || exit
34
35 eval `sed -n 's/^#define.*_width[ ]*\([0-9]*\).*$/w=\1/p
36 s/^#define.*_height[ ]*\([0-9]*\).*$/h=\1/p
37 /{/q' $tmp`
38
39 if test $w -gt $size -o $h -gt $size
40 then
41 if test $w -ge $h
42 then dim=xsize
43 else dim=ysize
44 fi
45
46 xbmtopbm < $tmp | ppmscale -$dim $size |
47 ppmtopgm | pgmtopbm | pbmtoxbm > $tmp2
48 mv $tmp2 $tmp
49 fi
50
51 xbmtopbm < $tmp > $tmp2
52 pbmmake $size $size | pnmpaste $tmp2 0 0 | pbmtoxbm