File: ps2png

package info (click to toggle)
tth 2.92-1
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 1,268 kB
  • ctags: 656
  • sloc: sh: 57; makefile: 42
file content (20 lines) | stat: -rwxr-xr-x 777 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
#ps2png script by Ian Hutchinson 1999; use at your own risk.
#You need Ghostscript and the netpbm utilities installed. 
if [ $# -lt 2 ] ; then
       echo " Usage: ps2png <file.ps> <file.gif> [<icon.gif>]" 1>&2
       exit 1
else 
    echo "Calling ghostscript to convert, please wait ..." >&2
    filein=$1
# The following uses the internal gs driver but does no cropping etc.
#    gs -sDEVICE=png256 -sOutputFile=$2 -sNOPAUSE -q $filein -c showpage -c quit
    gs -sDEVICE=ppmraw -sOutputFile=- -sNOPAUSE -q $filein -c showpage -c quit | pnmcrop| pnmmargin -white 10 | pnmtopng >$2
    shift 2
    if [ $# -eq 1 ] ;then
# Make an icon file.
       gs -sDEVICE=ppmraw -sOutputFile=- -sNOPAUSE -r12 -q $filein -c showpage -c quit | pnmcrop|  pnmtopng >$1
    fi
fi