]> git.lyx.org Git - lyx.git/blob - lib/scripts/convertDefault.sh
make sure docs are disted
[lyx.git] / lib / scripts / convertDefault.sh
1 #! /bin/sh
2
3 # file convertDefault.sh
4 # This file is part of LyX, the document processor.
5 # Licence details can be found in the file COPYING.
6
7 # author Herbert Voß
8
9 # Full author contact details are available in file CREDITS.
10
11 # The default converter if no other has been defined by the user from the
12 # Conversion->Converter tab of the Preferences dialog.
13
14 # The user can also redefine this default converter, placing their
15 # replacement in ~/.lyx/scripts
16
17 # converts an image from $1 to $2 format
18 convert -depth 8 $1 $2 || {
19         echo "$0 ERROR"
20         echo "Execution of \"convert\" failed."
21         exit 1
22 }
23
24 # It appears that convert succeeded, but we know better than to trust it ;-)
25 # convert is passed strings in the form "FMT:FILENAME", so use the ':' to
26 # delimit the two parts.
27 # Note that Win32 filenames have the form 'C:\my\file',
28 # so use everything from the first ':' to the end of the line.
29 FILE=`echo $2 | cut -d ':' -f 2-`
30
31 test -f $FILE || {
32         echo "$0 ERROR"
33         echo "Unable to find file \"${FILE}\""
34         exit 1
35 }
36
37 echo "$0 generated file \"${FILE}\" successfully."