Manual:How to use DjVu with MediaWiki

From MediaWiki.org
Jump to: navigation, search
Example
Example - Page 5

Contents

[edit] How that works ?

[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 aptitude or Synaptic in Debian derivatives
  • install netpbm package (use aptitude or Synaptic in Debian derivatives)
  • Finally, add (or modify) the code lines below in the LocalSettings.php file (not in the DefaultSettings.php):
    $wgFileExtensions[] = 'djvu';
    $wgDjvuDump = "djvudump";
    $wgDjvuRenderer = "ddjvu";
    $wgDjvuTxt = "djvutxt";
    $wgDjvuPostProcessor = "ppmtojpeg";
    $wgDjvuOutputExtension = 'jpg';

[edit] How to install on Win32

WARNING : These explanations are obsolete, nothing works.

  1. Download the DjVuLibre software (which includes djvudump.exe and ddjvu.exe files).
  2. Install in "C:\DjVuLibre" (for example).
  3. Download the NetPbm complete package (which includes pnmtojpeg.exe, pnmtopng.exe, ... files).
  4. Install in "C:\GnuWin32\NetPbm"
  5. Add "C:\GnuWin32\NetPbm\bin" to the Windows PATH Environment Variable (and reboot the computer).
  6. Finally, add (or modify) the code lines below in the LocalSettings.php file (not in the DefaultSettings.php):
    • $wgFileExtensions[] = '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] Problems and solutions

  • If you got «Error creating thumbnail: terminate called after throwing an instance of 'DJVU::GException' ppmtojpeg: EOF / read error reading magic number» when view file, increase the $wgMaxShellMemory.
  • Thumbnails of DjVu-file with non-Latin name are absent in a namespace Page. If you use extension WebStore in your own wiki, then in file $IP/extensions/WebStore/404-handler.php replace next string:
    $rel = substr( $url, strlen( $thumbBase ) + 1 ); // plus one for slash
    by
    $rel = urldecode(substr( $url, strlen( $thumbBase ) + 1 )); // plus one for slash

[edit] Other page

[edit] See also

Language: English  • Français
Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox