mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/PageImages
synced 2024-12-02 20:06:57 +00:00
More accurate calculation of image width for thumbnails
Now uses the actual default values rather than '250'. Change-Id: I20f3583bc3863fbe81589df391d015c4cfae3cb6
This commit is contained in:
parent
2e7b38b498
commit
566ce74936
|
@ -80,6 +80,8 @@ class PageImages {
|
|||
* @param File $file
|
||||
*/
|
||||
private static function calcWidth( array &$params, File $file ) {
|
||||
global $wgThumbLimits, $wgDefaultUserOptions;
|
||||
|
||||
if ( isset( $params['handler']['width'] ) ) {
|
||||
return;
|
||||
}
|
||||
|
@ -90,7 +92,7 @@ class PageImages {
|
|||
|| isset( $params['frame']['thumb'] )
|
||||
|| isset( $params['frame']['frameless'] ) )
|
||||
{
|
||||
$params['handler']['width'] = 250;
|
||||
$params['handler']['width'] = $wgThumbLimits[$wgDefaultUserOptions['thumbsize']];
|
||||
} else {
|
||||
$params['handler']['width'] = $file->getWidth();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue