repo.or.cz
/
transyMjolnir.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
creatio ex nihilo
[transyMjolnir.git]
/
ps2png.sh
blob
a7ec70aa358a07b78bfb84cde073949158647d65
1
#!/usr/bin/env bash
2
3
if
[
-z
"
$1
"
-o -z
"
$2
"
];
then
4
echo
"
${0##*/}
: generate PNG raster image from PostScript file"
>&
2
5
echo
"usage:
${0##*/}
<infile> <outfile> [outsize] [outres]"
>&
2
6
exit
1
7
fi
8
9
10
RES
=
72
11
BOX
=
128
12
if
[
-n
"
$4
"
];
then
13
RES
=
"
$4
"
14
fi
15
if
[
-n
"
$3
"
];
then
16
BOX
=
"
$3
"
17
fi
18
19
if
!
echo
"
$BOX
"
|
grep
x
;
then
20
BOX
=
"
${BOX}
x
${BOX}
"
21
fi
22
23
24
gs
-sDEVICE
=
pngalpha \
25
-q
\
26
-dNOPAUSE
\
27
-sOutputFile
=
"
$2
"
\
28
-r
"
$RES
"
\
29
-g
"
$BOX
"
\
30
"
$1
"
31
32
exit
"$?"