diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2012-01-12 13:42:29 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2012-01-12 13:42:29 +0100 |
commit | ba0fc4fa20067528effd4802e53ceeb959640825 (patch) | |
tree | 4f62217349d3afa39dbba3f7e19dac0aecb344f6 /includes/media/Generic.php | |
parent | ca32f08966f1b51fcb19460f0996bb0c4048e6fe (diff) |
Update to MediaWiki 1.18.1
Diffstat (limited to 'includes/media/Generic.php')
-rw-r--r-- | includes/media/Generic.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/includes/media/Generic.php b/includes/media/Generic.php index 48735ebf..6ef21e1e 100644 --- a/includes/media/Generic.php +++ b/includes/media/Generic.php @@ -570,43 +570,43 @@ abstract class ImageHandler extends MediaHandler { $srcWidth = $image->getWidth( $params['page'] ); $srcHeight = $image->getHeight( $params['page'] ); - + if ( isset( $params['height'] ) && $params['height'] != -1 ) { # Height & width were both set if ( $params['width'] * $srcHeight > $params['height'] * $srcWidth ) { # Height is the relative smaller dimension, so scale width accordingly $params['width'] = wfFitBoxWidth( $srcWidth, $srcHeight, $params['height'] ); - + if ( $params['width'] == 0 ) { # Very small image, so we need to rely on client side scaling :( $params['width'] = 1; } - + $params['physicalWidth'] = $params['width']; } else { # Height was crap, unset it so that it will be calculated later unset( $params['height'] ); } } - + if ( !isset( $params['physicalWidth'] ) ) { # Passed all validations, so set the physicalWidth $params['physicalWidth'] = $params['width']; } - + # Because thumbs are only referred to by width, the height always needs # to be scaled by the width to keep the thumbnail sizes consistent, # even if it was set inside the if block above - $params['physicalHeight'] = File::scaleHeight( $srcWidth, $srcHeight, + $params['physicalHeight'] = File::scaleHeight( $srcWidth, $srcHeight, $params['physicalWidth'] ); - # Set the height if it was not validated in the if block higher up + # Set the height if it was not validated in the if block higher up if ( !isset( $params['height'] ) || $params['height'] == -1 ) { $params['height'] = $params['physicalHeight']; } - - if ( !$this->validateThumbParams( $params['physicalWidth'], + + if ( !$this->validateThumbParams( $params['physicalWidth'], $params['physicalHeight'], $srcWidth, $srcHeight, $mimeType ) ) { return false; } |