From 63601400e476c6cf43d985f3e7b9864681695ed4 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 18 Jan 2013 16:46:04 +0100 Subject: Update to MediaWiki 1.20.2 this update includes: * adjusted Arch Linux skin * updated FluxBBAuthPlugin * patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024 --- includes/media/Bitmap.php | 64 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 46 insertions(+), 18 deletions(-) (limited to 'includes/media/Bitmap.php') diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php index 619485cc..99ac854b 100644 --- a/includes/media/Bitmap.php +++ b/includes/media/Bitmap.php @@ -1,6 +1,21 @@ $scalerParams['clientWidth'], + 'height' => $scalerParams['clientHeight'] + ); + return new ThumbnailImage( $image, $dstUrl, false, $params ); } # Try to make a target path for the thumbnail @@ -205,8 +223,11 @@ class BitmapHandler extends ImageHandler { } elseif ( $mto ) { return $mto; } else { - return new ThumbnailImage( $image, $dstUrl, $scalerParams['clientWidth'], - $scalerParams['clientHeight'], $dstPath ); + $params = array( + 'width' => $scalerParams['clientWidth'], + 'height' => $scalerParams['clientHeight'] + ); + return new ThumbnailImage( $image, $dstUrl, $dstPath, $params ); } } @@ -243,14 +264,17 @@ class BitmapHandler extends ImageHandler { * client side * * @param $image File File associated with this thumbnail - * @param $params array Array with scaler params + * @param $scalerParams array Array with scaler params * @return ThumbnailImage * - * @fixme no rotation support + * @todo fixme: no rotation support */ - protected function getClientScalingThumbnailImage( $image, $params ) { - return new ThumbnailImage( $image, $image->getURL(), - $params['clientWidth'], $params['clientHeight'], null ); + protected function getClientScalingThumbnailImage( $image, $scalerParams ) { + $params = array( + 'width' => $scalerParams['clientWidth'], + 'height' => $scalerParams['clientHeight'] + ); + return new ThumbnailImage( $image, $image->getURL(), null, $params ); } /** @@ -259,7 +283,7 @@ class BitmapHandler extends ImageHandler { * @param $image File File associated with this thumbnail * @param $params array Array with scaler params * - * @return MediaTransformError Error object if error occured, false (=no error) otherwise + * @return MediaTransformError Error object if error occurred, false (=no error) otherwise */ protected function transformImageMagick( $image, $params ) { # use ImageMagick @@ -358,7 +382,7 @@ class BitmapHandler extends ImageHandler { * @param $image File File associated with this thumbnail * @param $params array Array with scaler params * - * @return MediaTransformError Error object if error occured, false (=no error) otherwise + * @return MediaTransformError Error object if error occurred, false (=no error) otherwise */ protected function transformImageMagickExt( $image, $params ) { global $wgSharpenReductionThreshold, $wgSharpenParameter, $wgMaxAnimatedGifArea; @@ -435,7 +459,7 @@ class BitmapHandler extends ImageHandler { * @param $image File File associated with this thumbnail * @param $params array Array with scaler params * - * @return MediaTransformError Error object if error occured, false (=no error) otherwise + * @return MediaTransformError Error object if error occurred, false (=no error) otherwise */ protected function transformCustom( $image, $params ) { # Use a custom convert command @@ -462,7 +486,7 @@ class BitmapHandler extends ImageHandler { } /** - * Log an error that occured in an external process + * Log an error that occurred in an external process * * @param $retval int * @param $err int @@ -491,7 +515,7 @@ class BitmapHandler extends ImageHandler { * @param $image File File associated with this thumbnail * @param $params array Array with scaler params * - * @return MediaTransformError Error object if error occured, false (=no error) otherwise + * @return MediaTransformError Error object if error occurred, false (=no error) otherwise */ protected function transformGd( $image, $params ) { # Use PHP's builtin GD library functions. @@ -509,7 +533,7 @@ class BitmapHandler extends ImageHandler { if ( !isset( $typemap[$params['mimeType']] ) ) { $err = 'Image type not supported'; wfDebug( "$err\n" ); - $errMsg = wfMsg( 'thumbnail_image-type' ); + $errMsg = wfMessage( 'thumbnail_image-type' )->text(); return $this->getMediaTransformError( $params, $errMsg ); } list( $loader, $colorStyle, $saveType ) = $typemap[$params['mimeType']]; @@ -517,14 +541,14 @@ class BitmapHandler extends ImageHandler { if ( !function_exists( $loader ) ) { $err = "Incomplete GD library configuration: missing function $loader"; wfDebug( "$err\n" ); - $errMsg = wfMsg( 'thumbnail_gd-library', $loader ); + $errMsg = wfMessage( 'thumbnail_gd-library', $loader )->text(); return $this->getMediaTransformError( $params, $errMsg ); } if ( !file_exists( $params['srcPath'] ) ) { $err = "File seems to be missing: {$params['srcPath']}"; wfDebug( "$err\n" ); - $errMsg = wfMsg( 'thumbnail_image-missing', $params['srcPath'] ); + $errMsg = wfMessage( 'thumbnail_image-missing', $params['srcPath'] )->text(); return $this->getMediaTransformError( $params, $errMsg ); } @@ -572,6 +596,7 @@ class BitmapHandler extends ImageHandler { /** * Escape a string for ImageMagick's property input (e.g. -set -comment) * See InterpretImageProperties() in magick/property.c + * @return mixed|string */ function escapeMagickProperty( $s ) { // Double the backslashes @@ -599,6 +624,7 @@ class BitmapHandler extends ImageHandler { * * @param $path string The file path * @param $scene string The scene specification, or false if there is none + * @return string */ function escapeMagickInput( $path, $scene = false ) { # Die on initial metacharacters (caller should prepend path) @@ -616,6 +642,7 @@ class BitmapHandler extends ImageHandler { /** * Escape a string for ImageMagick's output filename. See * InterpretImageFilename() in magick/image.c. + * @return string */ function escapeMagickOutput( $path, $scene = false ) { $path = str_replace( '%', '%%', $path ); @@ -628,6 +655,7 @@ class BitmapHandler extends ImageHandler { * * @param $path string The file path * @param $scene string The scene specification, or false if there is none + * @return string */ protected function escapeMagickPath( $path, $scene = false ) { # Die on format specifiers (other than drive letters). The regex is -- cgit v1.2.2