Extension:VipsScaler/cs

Category:GPL licensed extensions/cs
Příručka k rozšířením MediaWiki
VipsScaler
Stav rozšíření: stabilníCategory:Stable extensions/cs
Implementace MédiaCategory:Media handling extensions/cs
Popis Umožňuje škálovat obrázky PNG a JPEG pomocí VIPS.
Autoři Bryan Tong Minh (Bryandiskuse)
MediaWiki 1.19+Category:Extensions with manual MediaWiki version
Změny v databázi Ne
Licence GNU General Public License 2.0 nebo novější
Stáhnout Category:Extensions in Wikimedia version control/cs
README
  • $wgVipsCommand
  • $wgVipsOptions
  • $wgVipsTestExpiry
  • $wgVipsExposeTestPage
  • $wgVipsThumbnailerHost
  • vipsscaler-test
Čtvrtletní stahování 7 (Ranked 88th)
Veřejné wiki používající rozšíření 1,811 (Ranked 203rd)
Přeložte rozšíření VipsScaler, používá-li lokalizaci z translatewiki.net
Problémy Otevřené úkoly · Nahlásit chybu
Category:All extensions/cs

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).

Installation

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

Mac OS X

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

VipsScaler extension

  • Install VIPS
  • Stáhněte soubor/y a vložte je do adresáře pojmenovaného VipsScaler ve vaší složce extensions/.
    Vývojáři a přispěvatelé kódu by si místo toho měli nainstalovat rozšíření from Git pomocí:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/VipsScaler
  • Na konec vašeho souboru LocalSettings.php přidejte následující kód:
    wfLoadExtension( 'VipsScaler' );
    
  • Configure as required.
  • Yes Dokončeno – Přejděte na stránku Special:Version vaší wiki a zkontrolujte, zda bylo rozšíření úspěšně nainstalováno.

Configuration

$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 - Use im_resize_linear instead of 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).

See also

Category:Extensions used on Wikimedia/cs#VipsScaler/cs Category:Image extensions/cs
Category:All extensions/cs Category:BitmapHandlerCheckImageArea extensions/cs Category:BitmapHandlerTransform extensions/cs Category:Extensions in Wikimedia version control/cs Category:Extensions used on Wikimedia/cs Category:Extensions with manual MediaWiki version Category:GPL licensed extensions/cs Category:Image extensions/cs Category:Media handling extensions/cs Category:Stable extensions/cs