Manual:How to use DjVu with MediaWiki
From MediaWiki.org
Contents |
[edit] How that works ?
- Manual:$wgDjvuDump - Path of the djvudump executable.
- Manual:$wgDjvuOutputExtension - File extension for the DJVU post processor output.
- Manual:$wgDjvuPostProcessor - Path of the DJVU post processor.
- Manual:$wgDjvuRenderer - Path of the ddjvu DJVU renderer.
- Manual:$wgDjvuToXML - Path of the djvutoxml executable.
- Manual:$wgDjvuTxt - Path of the djvutxt executable.
[edit] How to install on GNU/Linux
- Install DjVuLibre :
- − Download the DjVuLibre package (which includes djvudump and ddjvu files). And, in the path :
- ./configure
- make
- make install
- − Or use Synaptic in Ubuntu
- − Download the DjVuLibre package (which includes djvudump and ddjvu files). And, in the path :
- If necessary, install QT4 (use Synaptic)
- install netpbm package (use Synaptic in Ubuntu)
- Finally, add (or modify) the code lines below in the LocalSettings.php file (not in the DefaultSettings.php):
- $wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'svg', 'djvu' );
- $wgDjvuDump = "djvudump";
- $wgDjvuRenderer = "ddjvu";
- $wgDjvuTxt = "djvutxt";
- $wgDjvuPostProcessor = "ppmtojpeg";
- $wgDjvuOutputExtension = 'jpg';
[edit] How to install on Win32
- Download the DjVuLibre software (which includes djvudump.exe and ddjvu.exe files).
- Install in "C:\DjVuLibre" (for example).
- Download the NetPbm complete package (which includes pnmtojpeg.exe, pnmtopng.exe, ... files).
- Install in "C:\GnuWin32\NetPbm"
- Add "C:\GnuWin32\NetPbm\bin" to the Windows PATH Environment Variable (and reboot the computer).
- Finally, add (or modify) the code lines below in the LocalSettings.php file (not in the DefaultSettings.php):
- $wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'svg', 'djvu' );
- $wgDjvuDump = 'C:/DjVuLibre/djvudump.exe';
- $wgDjvuRenderer = 'C:/DjVuLibre/ddjvu.exe';
- $wgDjvuTxt = 'C:/DjVuLibre/djvutxt.exe';
- $wgDjvuPostProcessor = 'pnmtojpeg.exe';
- $wgDjvuOutputExtension = 'jpg';
NOTES:
- don't use long paths in the $wgDjvuPostProcessor variable: it returns an Error creating thumbnail when 'C:' or '../' are written in the path.
- PHP needs memory to create thumbnails: this means a high memory_limit (~ 128MB) in the php.ini.
[edit] Next to do
- How to install DjVuLibre, Qt and netpbm on a server.
[edit] Bugs to fix
- Images don't seem to appear in namespace page :
- Error creating thumbnail: terminate called after throwing an instance of 'DJVU::GException' ppmtojpeg: EOF / read error reading magic number
- >>> see the french translation of this page.
- Error when trying to access to a thumbnail (with onglet image in namespace page)