Jump to content

Handbuch:Wie man DjVu mit MediaWiki verwendet

From mediawiki.org
This page is a translated version of the page Manual:How to use DjVu with MediaWiki and the translation is 53% complete.
DjVu leitet hier weiter. Diese Seite erklärt, wie MediaWiki mit DjVu funktionieren könnte. Für die Hilfeseite über wie man eine DjVu-Datei von einer PDF erstellt, siehe Erstellen einer DjVu-Datei.

Wie es funktioniert?

Beispiel
Beispiel - Seite 5


Wie man unter GNU/Linux installiert

For MediaWiki-Docker , run the following command to install all the necessary packages.
docker compose exec -u 0 mediawiki bash -c 'apt update && apt install djvulibre-bin netpbm'
  • Installiere 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 (package djvulibre-bin)
  • Install netpbm and netpbm-progs packages (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 = "pnmtojpeg";
    $wgDjvuOutputExtension = 'jpg';
    
  • For better thumbnails quality:
    $wgDjvuPostProcessor = "ppmtojpeg -quality=100";
    
  • Can also use png thumbnails with:
$wgDjvuPostProcessor = "pnmtopng";
$wgDjvuOutputExtension = 'png';


Wie man unter Win32 installiert

  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';
PHP needs memory to create thumbnails: this means a high "memory_limit" (~ 128MB) in the php.ini.

Wie man unter macOS installiert

  1. Installiere djvu und netpbm mit Hilfe der Homebrew-Paketverwaltung.
brew install djvulibre netpbm
  1. Folge den letzten Installationsschritt unter GNU/Linux

Next to do

  • Wie man DjVuLibre, Qt und netpbm auf einen Server installiert.

Probleme und Lösungen

  • 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 .
  • Under $wgDjvuOutputExtension = 'jpg' you can force pictures to PNG format with a client-side script. Useful wherever you don′t control MediaWiki setup.

Andere Seite

Siehe auch