Extension:VipsScaler/zh
Appearance
发行状态: 稳定版 |
|
|---|---|
| 实现 | 媒体 |
| 描述 | Allows to scale PNG and JPEG images using VIPS |
| 作者 | Bryan Tong Minh (Bryan留言) |
| MediaWiki | 1.19+ |
| 数据库更改 | 否 |
|
|
|
|
| 许可证 | GNU General Public License 2.0 or later |
| 下載 | README |
| 前往translatewiki.net翻譯VipsScaler扩展 | |
| 問題 | 开启的任务 · 报告错误 |
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
- 下载文件,并解压
VipsScaler文件夹到extensions/目录中。
开发者和代码贡献人员应改从Git安装此扩展,输入:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/VipsScaler
- 請新增下列代码到您的LocalSettings.php文件的底部:
wfLoadExtension( 'VipsScaler' );
- Configure as required.
完成 – 請导航至您的wiki上的Special:Version,以验证此扩展已成功安装。
配置
| Name | Default | Description |
|---|---|---|
$wgVipsCommand
|
/usr/bin/vips
|
Path to the "vips" command. |
$wgVipsOptions
|
empty | Options and conditions to scale images with this scaler. 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:
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
|
false
|
Allow testing via "Special:VipsTest", which lets you verify it is working and see the difference in output quality. |
See also
- Extension:Thumbro - Forked and rewritten version of this extension
