Erweiterung:VipsScaler

This page is a translated version of the page Extension:VipsScaler and the translation is 32% complete.
Outdated translations are marked like this.
MediaWiki-Erweiterungen
VipsScaler
Freigabestatus: stabil
Einbindung Medien
Beschreibung Erlaubt es, PNG- und JPEG-Bilder mit VIPS zu skalieren
Autor(en) Bryan Tong Minh (BryanDiskussion)
MediaWiki 1.19+
Datenbankänderungen Nein
Lizenz GNU General Public License 2.0 oder neuer
Herunterladen
README
  • $wgVipsCommand
  • $wgVipsOptions
  • $wgVipsTestExpiry
  • $wgVipsExposeTestPage
  • $wgVipsThumbnailerHost
  • vipsscaler-test
Quarterly downloads 9 (Ranked 131st)
Public wikis using 1,811 (Ranked 203rd)
Übersetze die VipsScaler-Erweiterung, wenn sie auf translatewiki.net verfügbar ist
Probleme Offene Aufgaben · Einen Fehler melden

The VipsScaler extension creates JPG and PNG thumbnails faster and at low memory usage. The extension replaces MediaWiki core's Media handlers for bitmaps, which default to ImageMagick. It is powered by the free image processing software VIPS, which speeds up resizing of large PNGs, and it improves the appearance of shrunken JPEGs.

The extension shells out to the VIPS binary. By configuring $wgVipsOptions, it can be configured to scale only certain files (for example, big PNG files).

VIPS

Install VIPS. It can be downloaded from https://libvips.github.io/libvips or your OS repository (see below).

Debian / Ubuntu

$ apt-get install libvips-tools

macOS

$ brew install homebrew/science/vips
$ binary symlink is /usr/local/bin/vips

VipsScaler-Erweiterung installieren

  • Install VIPS
  • Die Erweiterung herunterladen und die Datei(en) in ein Verzeichnis namens VipsScaler im Ordner extensions/ ablegen.
    Entwickler und Code-Beitragende sollten stattdessen die Erweiterung von Git installieren, mit:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/VipsScaler
  • Folgenden Code am Ende deiner LocalSettings.php -Datei einfügen:
    wfLoadExtension( 'VipsScaler' );
    
  • Configure as required.
  • Yes Erledigt – Navigiere zu Special:Version in deinem Wiki, um zu überprüfen, ob die Erweiterung erfolgreich installiert wurde.

Konfiguration

$wgVipsCommand
Path to the "vips" command (default: /usr/bin/vips).
$wgVipsOptions
Options and conditions to scale images with this scaler (default: empty). Set to an array of arrays. The inner array contains a condition array, which contains a list of conditions the image should pass for it to be scaled with VIPS. Conditions are mimeType, minArea, maxArea, minShrinkFactor, maxShrinkFactor. The other items in the array are options. Options available are:
  • sharpen - Set to an array with keys 'radius' and 'sigma', parameters to the Gaussian sharpen matrix.
  • preconvert - Convert the file to a .v file first, which costs some space but saves memory on the actual downsize
  • bilinear - Verwende im_resize_linear statt im_shrink
  • convolution - Apply specified convolution matrix
  • setcomment - Add an EXIF comment specifying the source of the file. Requires $wgExiv2Command to be set properly.
Example
$wgVipsOptions = [
  // Sharpen jpeg files which are shrunk more than 1.2
  [
    'conditions' => [
      'mimeType' => 'image/jpeg',
      'minShrinkFactor' => 1.2,
    ],
    'sharpen' => [
      'radius' => 0,
      'sigma' => 0.8
    ],
  ],
  // Other jpeg files
  [
    'conditions' =>[
      'mimeType' => 'image/jpeg',
    ],
    'sharpen' => false,
    'bilinear' => true,
  ],
  // Do a simple shrink for PNGs
  [
    'conditions' => [
      'mimeType' => 'image/png',
    ],
  ],
];
$wgVipsExposeTestPage
Allow testing via "Special:VipsTest", which lets you verify it is working and see the difference in output quality. (default: false).