]> git.lyx.org Git - lyx.git/blob - lib/scripts/convertDefault.sh
Extract the necessary magic from epstopdf.
[lyx.git] / lib / scripts / convertDefault.sh
1 #! /bin/sh
2 # The default converter if no other has been defined by the user from the
3 # Conversion->Converter tab of the Preferences dialog.
4 #
5 # The user can also redefine this default converter, placing their
6 # replacement in ~/.lyx/scripts
7 #
8 # converts an image from $1 to $2 format
9 convert -depth 8 $1 $2
10 if [ $? -ne 0 ]; then
11     exit $?
12 fi
13
14 # It appears that convert succeeded, but we know better than to trust it ;-)
15 # convert is passed strings in the form "FMT:FILENAME", so use the ':' to
16 # delimit the two parts.
17 FILE=`echo $2 | cut -d ':' -f 2`
18
19 # FSTATUS == 0 is the file exists and == 1 if it does not.
20 FSTATUS=0
21 test -f $FILE || FSTATUS=1
22
23 exit $FSTATUS