/**
* What language to render file in if none selected.
*
+ * @param File $file
* @return string Language code.
*/
public function getDefaultRenderLanguage( File $file ) {
/**
* We do not support making animated svg thumbnails
+ * @param File $file
+ * @return bool
*/
function canAnimateThumbnail( $file ) {
return false;
$tmpDir = wfTempDir() . '/svg_' . wfRandomString( 24 );
$lnPath = "$tmpDir/" . basename( $srcPath );
$ok = mkdir( $tmpDir, 0771 ) && symlink( $srcPath, $lnPath );
- $cleaner = new ScopedCallback( function() use ( $tmpDir, $lnPath ) {
+ $cleaner = new ScopedCallback( function () use ( $tmpDir, $lnPath ) {
wfSuppressWarnings();
unlink( $lnPath );
rmdir( $tmpDir );
$env['LANG'] = $lang;
}
- wfProfileIn( 'rsvg' );
wfDebug( __METHOD__ . ": $cmd\n" );
$err = wfShellExecWithStderr( $cmd, $retval, $env );
- wfProfileOut( 'rsvg' );
}
}
$removed = $this->removeBadFile( $dstPath, $retval );
$metadata = array( 'version' => self::SVG_METADATA_VERSION );
try {
$metadata += SVGMetadataExtractor::getMetadata( $filename );
- } catch ( MWException $e ) { // @todo SVG specific exceptions
+ } catch ( Exception $e ) { // @todo SVG specific exceptions
// File not found, broken, etc.
$metadata['error'] = array(
'message' => $e->getMessage(),