On Sat, 15 Sep 2001 17:16:47 +0200 wrote Ulrik Sandberg <[EMAIL PROTECTED]>:

> On Friday, 14 September 2001 11:48, Guenter Milde wrote:
>                                                                       
> > Use the eps2eps script from my recent reply to the list ...
> 
> The script eps2eps has an annoying side effect. It deletes your files.

This is not only annoying, it is fatal! Thanks to Ulrik for pointing this
out. 

Actually, I never tried with two arguments, I just found it on my
system and it worked for me.
I want to apologize for my untested publication of the script and hope, no
serious damage occured. 

I rewrote the script, and this time also tested, so I hope the current
version will work without hazard to your data. (But, of course, no warranty)

(BTW: If you have eps2epsi and python on your system, using the variant from 
the recent post of Kaspar Pflugshaupt might be the better choice, as
ghostscript renders included textstrings as bitmaps)



#!/bin/sh
# eps2eps -- in order to correct bounding box
# $Id: eps2eps,v 1.3 2000/10/29 23:38:18 matej Exp $
# $Log: eps2eps,v $
#
# Revision 1.1  2000/10/29 23:28:59  matej
# Initial revision
#
# Revision 1.2  2000/10/29 23:35:34  matej
# Correction of if command -- shit!
#
# Revision 1.3  2000/10/29 23:38:18  matej
# TMP setting in true side of if.
#
# Revision 1.4 2001/09/17 GM <[EMAIL PROTECTED]>
# Fixed a serious bug where eps2eps would remove all files in current dir 
# if called with two arguments or nonworking `mktemp`
# (moved the trap into the if [ -z $2] branch and removed the star after 
#  $TMP in the rm command)
# removed use of mktemp (as some people don't have it and there is no real
# fear to destroy something needed when overwriting an existing file named
# /tmp.eps2eps.tmp)

if [ $# -gt 0 ]
then
     if [ -f $1 ]
     then
        if [ $# -eq 1 ]
        then
            TMP="/tmp/eps2eps.tmp"
            trap "rm $TMP 2>/dev/null" 0
            cp $1 $TMP
            INPUT=$TMP
            OUTPUT=$1
        else
            INPUT=$1
            OUTPUT=$2
        fi
        gs -dBATCH -dNOPAUSE -sDEVICE=epswrite -sOutputFile=$OUTPUT $INPUT
        exit
     else
     echo "eps2eps: file $1 does not exist "
     fi
fi
echo "eps2eps: Let ghostscript compute a correct bounding box."
echo "         Works for .ps and .eps files."
echo "         However, gs renders included text as bitmap :-("
echo "  Usage: eps2eps infile [outfile]"



Guenter

--
[EMAIL PROTECTED]

  • eps2eps Ulrik Sandberg
    • Guenter Milde

Reply via email to