File: makecover

package info (click to toggle)
grunch 1.3-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 204 kB
  • ctags: 25
  • sloc: sh: 830; ansic: 155; perl: 91; makefile: 69
file content (47 lines) | stat: -rwxr-xr-x 973 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
resolution=72
pixwidth=$((resolution*50/10))
linerwidth=$((resolution*4))
liner=0
rm -f ~/.grunch/tmp/$1.ps
cat << STOP > ~/.grunch/tmp/$1.ps
%!
90 rotate
20 -600 translate
0 0 moveto
gsave
STOP
tifftopnm $1-b-autojoin.tif | ppmtopgm | \
  pnmscale -xysize $pixwidth  $pixwidth | \
  pnmtops -width 5 -height 5 -dpi 300 -noturn | \
  fgrep -v showpage >> ~/.grunch/tmp/$1.ps
cat << STOP >> ~/.grunch/tmp/$1.ps
grestore
357 0 moveto
[1 4] 0 setdash
0 setlinewidth
357 700 lineto
710 0 moveto
710 355 lineto
-10 5 moveto
710 5 lineto
-10 355 moveto
710 355 lineto
stroke
[] 0 setdash
gsave
355 0 translate
STOP
tifftopnm $1-a-autojoin.tif | ppmtopgm | \
  pnmscale -xysize $pixwidth  $pixwidth | \
  pnmtops -width 5 -height 5 -dpi 300 -noturn | \
  fgrep -v showpage >> ~/.grunch/tmp/$1.ps
cat << STOP >> ~/.grunch/tmp/$1.ps
grestore
statusdict begin
/manualfeed true def
/manualfeedtimeout 20 def
showpage
STOP
cat ~/.grunch/tmp/$1.ps
rm -f ~/.grunch/tmp/$1.ps