2014-05-28

chg, add

← Older revision

Revision as of 21:02, 28 May 2014

Line 11:

Line 11:

 

 

 

This variable contains an array of 2-element arrays. Each of these defines a width/height pair describing a maximum image size (in pixels). The image sizes defined in this variable are used on the user preference page to allow the user to specify an image size-limit when viewing image pages. In order to reduce the amount of disk space taken up by thumbnails of many different sizes, limits can only be selected from this list.

 

This variable contains an array of 2-element arrays. Each of these defines a width/height pair describing a maximum image size (in pixels). The image sizes defined in this variable are used on the user preference page to allow the user to specify an image size-limit when viewing image pages. In order to reduce the amount of disk space taken up by thumbnails of many different sizes, limits can only be selected from this list.



 



If you change this array, you might also want to change the [[Manual:$wgDefaultUserOptions|default option]] for image sizes on image pages. By default

 



<source lang="php">

 



$wgDefaultUserOptions['imagesize'] = 2;

 



</source>

 



which, by default, corresponds to 800x600 in this array.

 



 



If you are using a skin which has a fixed width for page content, you will probably want to make the maximum size equal to that width. Put these settings in your [[Manual:LocalSettings.php|LocalSettings.php]]:

 



<syntaxhighlight lang="php">

 



//Don't allow larger image sizes because they will ruin the page format

 



$wgImageLimits = array(

 



array( 320, 240 ),

 



array( 500, 375 )

 



);

 



// By default display the larger option

 



$wgDefaultUserOptions['imagesize'] = 1;

 



</syntaxhighlight>

 

 

 

 

This setting also determines the list of thumbnail links which are provided on the image page, just below the image.

 

This setting also determines the list of thumbnail links which are provided on the image page, just below the image.

Line 33:

Line 16:

 

{{Note|This setting relates to images as shown on image description pages (File: namespace). For thumbnails in articles and other wiki pages, see [[Manual:$wgThumbLimits|<code>$wgThumbLimits</code>]].}}

 

{{Note|This setting relates to images as shown on image description pages (File: namespace). For thumbnails in articles and other wiki pages, see [[Manual:$wgThumbLimits|<code>$wgThumbLimits</code>]].}}

 

 



== Default
Value
==

+

== Default ==

 

<syntaxhighlight lang="php">

 

<syntaxhighlight lang="php">

 

$wgImageLimits = array(

 

$wgImageLimits = array(

Line 43:

Line 26:

 

);

 

);

 

</syntaxhighlight>

 

</syntaxhighlight>

 

+

and

 

+

<source lang="php">

 

+

$wgDefaultUserOptions['imagesize'] = 2; // image size 800, 600

 

+

</source>

 

 

 

+

== Example ==

 

+

If you are using a skin which has a fixed width for page content, you will probably want to make the maximum size equal to that width. Put these settings in your [[Manual:LocalSettings.php|LocalSettings.php]]:

 

+

<syntaxhighlight lang="php">

 

+

//Don't allow larger image sizes because they will ruin the page format

 

+

$wgImageLimits = array(

 

+

array( 320, 240 ), // image size 0

 

+

array( 500, 375 ) // image size 1

 

+

);

 

+

</syntaxhighlight>

 

+

 

+

If you change this array, you also want to change the [[Manual:$wgDefaultUserOptions|default user option]] for image sizes on image pages. Each image size set is automatically associated with an integer value that may be used for the "imagesize" user option. This value always starts with "0" for the lowest image size set in the array and increases by 1 per additional image size defined, e.g. if five different image sizes were set the lowest value for the user option is "0" while "4" is the highest. [[Bugzilla:8858|If an invalid value is set the wiki will break!]]

 

+

 

+

<syntaxhighlight lang="php">

 

+

// By default display the larger option

 

+

$wgDefaultUserOptions['imagesize'] = 1; // image size 500, 375

 

+

</syntaxhighlight>

 

{{Languages}}

 

{{Languages}}

Show more