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:
kaldari 2014-05-01 16:47:03 -07:00
parent 2e7b38b498
commit 566ce74936

View file

@ -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();
}