diff options
author | albert-github <albert.tests@gmail.com> | 2019-09-09 12:44:19 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2019-09-09 12:44:19 (GMT) |
commit | 54288872a1eb5c36a5d8b6fbcc9cafb1f38cefad (patch) | |
tree | ae9a3858d2508f36a8e94807c5f604d5de7eac86 /src | |
parent | 81da20ff839843634ee6db5f517bfcb7ef87d4b9 (diff) | |
download | Doxygen-54288872a1eb5c36a5d8b6fbcc9cafb1f38cefad.zip Doxygen-54288872a1eb5c36a5d8b6fbcc9cafb1f38cefad.tar.gz Doxygen-54288872a1eb5c36a5d8b6fbcc9cafb1f38cefad.tar.bz2 |
Bug 674005 - Crop png formula environnment problem for HTML output
`divips -E` does not always return the correct bounding box. The program `ps2epsi` returns a good bounding box.
- don't use the `-E` with `dvips`
- convert the file from `dvips` with `ps2epsi` to an encapsulated postscript file
Diffstat (limited to 'src')
-rw-r--r-- | src/formula.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/formula.cpp b/src/formula.cpp index 1c5042e..534f56a 100644 --- a/src/formula.cpp +++ b/src/formula.cpp @@ -118,11 +118,12 @@ void FormulaList::generateBitmaps(const char *path) int pageNum=*pagePtr; msg("Generating image form_%d.png for formula\n",pageNum); char dviArgs[4096]; + char psArgs[4096]; QCString formBase; formBase.sprintf("_form%d",pageNum); // run dvips to convert the page with number pageIndex to an - // encapsulated postscript. - sprintf(dviArgs,"-q -D 600 -E -n 1 -p %d -o %s.eps _formulas.dvi", + // postscript file. + sprintf(dviArgs,"-q -D 600 -n 1 -p %d -o %s_tmp.ps _formulas.dvi", pageIndex,formBase.data()); portable_sysTimerStart(); if (portable_system("dvips",dviArgs)!=0) @@ -133,6 +134,18 @@ void FormulaList::generateBitmaps(const char *path) return; } portable_sysTimerStop(); + // run ps2epsi to convert to an encapsulated postscript file with + // boundingbox (dvips with -E has some problems here). + sprintf(psArgs,"%s_tmp.ps %s.eps",formBase.data(),formBase.data()); + portable_sysTimerStart(); + if (portable_system("ps2epsi",psArgs)!=0) + { + err("Problems running ps2epsi. Check your installation!\n"); + portable_sysTimerStop(); + QDir::setCurrent(oldDir); + return; + } + portable_sysTimerStop(); // now we read the generated postscript file to extract the bounding box QFileInfo fi(formBase+".eps"); if (fi.exists()) @@ -282,6 +295,7 @@ void FormulaList::generateBitmaps(const char *path) f.close(); } // remove intermediate image files + thisDir.remove(formBase+"_tmp.ps"); thisDir.remove(formBase+".eps"); thisDir.remove(formBase+".pnm"); thisDir.remove(formBase+".ps"); |