Fix bug 2418 (hopefully)

* lib/configure.py:
	Check whether convert understands the -define option, and, if so,
	define a new converter PDF->PNG such that the CropBox rather than
	the MediaBox is used in the conversion.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17078 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2007-02-06 23:44:43 +00:00
parent aba891d408
commit 61b4f87330

View File

@ -8,7 +8,7 @@
# \author Bo Peng
# Full author contact details are available in file CREDITS.
import sys, os, re, shutil, glob
import sys, os, re, shutil, glob, commands
class Tee:
@ -406,6 +406,13 @@ def checkConverterEntries():
checkProg('an EPS -> PDF converter', ['epstopdf'],
rc_entry = [ r'\converter eps pdf "epstopdf --outfile=$$o $$i" ""', ''])
#
path, convert = checkProg('a PDF -> PNG converter', ['convert'])
if convert != '':
# check whether convert supports the -define option
conv_opts = "-define pdf:use-cropbox=true -depth 8"
if not 'Unrecognized' in commands.getoutput('convert ' + conv_opts):
addToRC(r'\converter pdf png "convert %s pdf:$$i png:$$o" ""' % conv_opts)
#
checkProg('a Grace -> Image converter', ['gracebat'],
rc_entry = [
r'''\converter agr eps "gracebat -hardcopy -printfile $$o -hdevice EPS $$i 2>/dev/null" ""