mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/PageImages
synced 2024-12-11 00:02:15 +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
|
* @param File $file
|
||||||
*/
|
*/
|
||||||
private static function calcWidth( array &$params, File $file ) {
|
private static function calcWidth( array &$params, File $file ) {
|
||||||
|
global $wgThumbLimits, $wgDefaultUserOptions;
|
||||||
|
|
||||||
if ( isset( $params['handler']['width'] ) ) {
|
if ( isset( $params['handler']['width'] ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -90,7 +92,7 @@ class PageImages {
|
||||||
|| isset( $params['frame']['thumb'] )
|
|| isset( $params['frame']['thumb'] )
|
||||||
|| isset( $params['frame']['frameless'] ) )
|
|| isset( $params['frame']['frameless'] ) )
|
||||||
{
|
{
|
||||||
$params['handler']['width'] = 250;
|
$params['handler']['width'] = $wgThumbLimits[$wgDefaultUserOptions['thumbsize']];
|
||||||
} else {
|
} else {
|
||||||
$params['handler']['width'] = $file->getWidth();
|
$params['handler']['width'] = $file->getWidth();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue