Merge "(bug 457) use semantic headings for the navigation menu"
[lhc/web/wiklou.git] / includes / media / SVG.php
index a9d1758..53716df 100644 (file)
@@ -117,7 +117,7 @@ class SvgHandler extends ImageHandler {
                $physicalHeight = $params['physicalHeight'];
 
                if ( $flags & self::TRANSFORM_LATER ) {
-                       return new ThumbnailImage( $image, $dstUrl, $clientWidth, $clientHeight, $dstPath );
+                       return new ThumbnailImage( $image, $dstUrl, $dstPath, $params );
                }
 
                if ( !wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ) ) {
@@ -128,21 +128,22 @@ class SvgHandler extends ImageHandler {
                $srcPath = $image->getLocalRefPath();
                $status = $this->rasterize( $srcPath, $dstPath, $physicalWidth, $physicalHeight );
                if( $status === true ) {
-                       return new ThumbnailImage( $image, $dstUrl, $clientWidth, $clientHeight, $dstPath );
+                       return new ThumbnailImage( $image, $dstUrl, $dstPath, $params );
                } else {
                        return $status; // MediaTransformError
                }
        }
 
        /**
-       * Transform an SVG file to PNG
-       * This function can be called outside of thumbnail contexts
-       * @param string $srcPath
-       * @param string $dstPath
-       * @param string $width
-       * @param string $height
-       * @return bool|MediaTransformError
-       */
+        * Transform an SVG file to PNG
+        * This function can be called outside of thumbnail contexts
+        * @param string $srcPath
+        * @param string $dstPath
+        * @param string $width
+        * @param string $height
+        * @throws MWException
+        * @return bool|MediaTransformError
+        */
        public function rasterize( $srcPath, $dstPath, $width, $height ) {
                global $wgSVGConverters, $wgSVGConverter, $wgSVGConverterPath;
                $err = false;
@@ -251,7 +252,7 @@ class SvgHandler extends ImageHandler {
                try {
                        $metadata = SVGMetadataExtractor::getMetadata( $filename );
                } catch( Exception $e ) {
-                       // Broken file?
+                       // Broken file?
                        wfDebug( __METHOD__ . ': ' . $e->getMessage() . "\n" );
                        return '0';
                }