Jump to content

手册:$wgThumbnailLimits

From mediawiki.org
This page is a translated version of the page Manual:$wgThumbLimits and the translation is 62% complete.
缩略图设置: $wgThumbLimits
List of image thumbnail sizes users can pick from.
引进版本:1.5.0
移除版本:仍在使用
允许的值:(正整数数组)
默认值:(参见下方)

细节

Users can select a default image thumbnail size in their preferences, which is used for all images displayed as thumbnails that lack an explicitly defined size. In order to reduce disk usage, users can only select a value from this list.

This setting relates to image thumbnails in articles and other wiki pages. For images as shown on image description pages (File: namespace), see $wgImageLimits . For errors such as "Error creating thumbnail: File with dimensions greater than 12.5 MP", see $wgMaxImageArea .

默认值

MediaWiki版本:
1.5
$wgThumbLimits = [
	120,
	150,
	180,
	200,
	250,
	300
];

示例

In order to reduce disk usage, the number of different values selectable from a list may by reduced. 在你的LocalSettings.php 加入这些设置:

// 不允许超过三种缩略图大小,以节约磁盘使用
$wgThumbLimits = [
	120, // 缩略图大小0
	250, // 缩略图大小1
	300, // 缩略图大小2
];

If you change this array, you also want to change the default user option for thumb sizes on pages. Each thumb size set is automatically associated with an integer value that may be used for the "thumbsize" user option. This value always starts with "0" for the lowest thumb size set in the array and increases by 1 per additional thumb size defined, e.g. if five different thumb sizes were set the lowest value for the user option is "0" while "4" is the highest.

// By default display the midsize option
$wgDefaultUserOptions['thumbsize'] = 1; // 缩略图大小250


参阅