Merge "Support for enabling skins in the installer"
[lhc/web/wiklou.git] / includes / media / Bitmap.php
index bf50f2d..c0d9b71 100644 (file)
@@ -117,6 +117,7 @@ class BitmapHandler extends ImageHandler {
                if ( !$this->normaliseParams( $image, $params ) ) {
                        return new TransformParameterError( $params );
                }
+
                # Create a parameter array to pass to the scaler
                $scalerParams = array(
                        # The size to which the image will be resized
@@ -187,7 +188,12 @@ class BitmapHandler extends ImageHandler {
                }
 
                # Transform functions and binaries need a FS source file
-               $scalerParams['srcPath'] = $image->getLocalRefPath();
+               $thumbnailSource = $image->getThumbnailSource( $params );
+
+               $scalerParams['srcPath'] = $thumbnailSource['path'];
+               $scalerParams['srcWidth'] = $thumbnailSource['width'];
+               $scalerParams['srcHeight'] = $thumbnailSource['height'];
+
                if ( $scalerParams['srcPath'] === false ) { // Failed to get local copy
                        wfDebugLog( 'thumbnail',
                                sprintf( 'Thumbnail failed on %s: could not get local copy of "%s"',
@@ -360,7 +366,7 @@ class BitmapHandler extends ImageHandler {
                        // background colour. After merging we reset the background
                        // to be white for the default background colour setting
                        // in the PNG image (which is used in old IE)
-                       $animation_post = array(
+                       $animation_pre = array(
                                '-background', 'transparent',
                                '-layers', 'merge',
                                '-background', 'white',
@@ -376,7 +382,7 @@ class BitmapHandler extends ImageHandler {
                                // bug 66323 - Greyscale images not rendered properly.
                                // So only take the "red" channel.
                                $channelOnly = array( '-channel', 'R', '-separate' );
-                               $animation_post = array_merge( $animation_post, $channelOnly );
+                               $animation_pre = array_merge( $animation_pre, $channelOnly );
                        }
                }
 
@@ -868,7 +874,7 @@ class BitmapHandler extends ImageHandler {
        }
 
        /**
-        * Rerurns whether the file needs to be rendered. Returns true if the
+        * Returns whether the file needs to be rendered. Returns true if the
         * file requires rotation and we are able to rotate it.
         *
         * @param File $file