diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2012-05-03 13:01:35 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2012-05-03 13:01:35 +0200 |
commit | d9022f63880ce039446fba8364f68e656b7bf4cb (patch) | |
tree | 16b40fbf17bf7c9ee6f4ead25b16dd192378050a /includes/media/SVG.php | |
parent | 27cf83d177256813e2e802241085fce5dd0f3fb9 (diff) |
Update to MediaWiki 1.19.0
Diffstat (limited to 'includes/media/SVG.php')
-rw-r--r-- | includes/media/SVG.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/includes/media/SVG.php b/includes/media/SVG.php index ceffd7c3..aac838e1 100644 --- a/includes/media/SVG.php +++ b/includes/media/SVG.php @@ -93,13 +93,13 @@ class SvgHandler extends ImageHandler { $clientHeight = $params['height']; $physicalWidth = $params['physicalWidth']; $physicalHeight = $params['physicalHeight']; - $srcPath = $image->getPath(); + $srcPath = $image->getLocalRefPath(); if ( $flags & self::TRANSFORM_LATER ) { return new ThumbnailImage( $image, $dstUrl, $clientWidth, $clientHeight, $dstPath ); } - if ( !wfMkdirParents( dirname( $dstPath ) ) ) { + if ( !wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ) ) { return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight, wfMsg( 'thumbnail_dest_directory' ) ); } @@ -119,7 +119,7 @@ class SvgHandler extends ImageHandler { * @param string $dstPath * @param string $width * @param string $height - * @returns TRUE/MediaTransformError + * @return true|MediaTransformError */ public function rasterize( $srcPath, $dstPath, $width, $height ) { global $wgSVGConverters, $wgSVGConverter, $wgSVGConverterPath; @@ -129,7 +129,7 @@ class SvgHandler extends ImageHandler { if ( is_array( $wgSVGConverters[$wgSVGConverter] ) ) { // This is a PHP callable $func = $wgSVGConverters[$wgSVGConverter][0]; - $args = array_merge( array( $srcPath, $dstPath, $width, $height ), + $args = array_merge( array( $srcPath, $dstPath, $width, $height ), array_slice( $wgSVGConverters[$wgSVGConverter], 1 ) ); if ( !is_callable( $func ) ) { throw new MWException( "$func is not callable" ); @@ -161,13 +161,13 @@ class SvgHandler extends ImageHandler { } return true; } - + public static function rasterizeImagickExt( $srcPath, $dstPath, $width, $height ) { $im = new Imagick( $srcPath ); $im->setImageFormat( 'png' ); $im->setBackgroundColor( 'transparent' ); $im->setImageDepth( 8 ); - + if ( !$im->thumbnailImage( intval( $width ), intval( $height ), /* fit */ false ) ) { return 'Could not resize image'; } |