global $wgSVGConverters, $wgSVGConverter;
if ( !isset( $wgSVGConverters[$wgSVGConverter] ) ) {
wfDebug( "\$wgSVGConverter is invalid, disabling SVG rendering.\n" );
+
return false;
} else {
return true;
return $metadata['animated'];
}
}
+
return false;
}
$params['physicalHeight'] = $wgSVGMaxSize;
}
}
+
return true;
}
$metadata = $this->unpackMetadata( $image->getMetadata() );
if ( isset( $metadata['error'] ) ) { // sanity check
$err = wfMessage( 'svg-long-error', $metadata['error']['message'] )->text();
+
return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight, $err );
}
$removed = $this->removeBadFile( $dstPath, $retval );
if ( $retval != 0 || $removed ) {
wfDebugLog( 'thumbnail', sprintf( 'thumbnail failed on %s: error %d "%s" from "%s"',
- wfHostname(), $retval, trim( $err ), $cmd ) );
+ wfHostname(), $retval, trim( $err ), $cmd ) );
+
return new MediaTransformError( 'thumbnail_error', $width, $height, $err );
}
+
return true;
}
if ( isset( $metadata['width'] ) && isset( $metadata['height'] ) ) {
return array( $metadata['width'], $metadata['height'], 'SVG',
- "width=\"{$metadata['width']}\" height=\"{$metadata['height']}\"" );
+ "width=\"{$metadata['width']}\" height=\"{$metadata['height']}\"" );
} else { // error
return array( 0, 0, 'SVG', "width=\"0\" height=\"0\"" );
}
);
wfDebug( __METHOD__ . ': ' . $e->getMessage() . "\n" );
}
+
return serialize( $metadata );
}
// Old but compatible
return self::METADATA_COMPATIBLE;
}
+
return self::METADATA_GOOD;
}
function visibleMetadataFields() {
$fields = array( 'objectname', 'imagedescription' );
+
return $fields;
}
$value
);
}
+
return $showMeta ? $result : false;
}
// Validate $code
if ( !Language::isValidBuiltinCode( $value ) ) {
wfDebug( "Invalid user language code\n" );
+
return false;
}
+
return true;
}
+
// Only lang, width and height are acceptable keys
return false;
}
if ( !isset( $params['width'] ) ) {
return false;
}
+
return "$lang{$params['width']}px";
}
$stdMetadata[$tag] = $value;
}
}
+
return $stdMetadata;
}
}