+
+ $status = $this->rasterize( $srcPath, $dstPath, $physicalWidth, $physicalHeight );
+ if( $status === true ) {
+ return new ThumbnailImage( $image, $dstUrl, $clientWidth, $clientHeight, $dstPath );
+ } 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
+ * @returns TRUE/MediaTransformError
+ */
+ public function rasterize( $srcPath, $dstPath, $width, $height ) {
+ global $wgSVGConverters, $wgSVGConverter, $wgSVGConverterPath;