MediaWiki  REL1_19
SvgHandler Class Reference

Handler for SVG images. More...

Inheritance diagram for SvgHandler:
Collaboration diagram for SvgHandler:

List of all members.

Public Member Functions

 doTransform ($image, $dstPath, $dstUrl, $params, $flags=0)
 formatMetadata ($file)
 getImageSize ($file, $path, $metadata=false)
 getLongDesc ($file)
 getMetadata ($file, $filename)
 Get handler-specific metadata which will be saved in the img_metadata field.
 getMetadataType ($image)
 Get a string describing the type of metadata, for display purposes.
 getThumbType ($ext, $mime, $params=null)
 Get the thumbnail extension and MIME type for a given source MIME type.
 isAnimatedImage ($file)
 isEnabled ()
 False if the handler is disabled for all files.
 isMetadataValid ($image, $metadata)
 Check if the metadata string is valid for this handler.
 isVectorized ($file)
 The material is vectorized and thus scaling is lossless.
 mustRender ($file)
 True if handled types cannot be displayed directly in a browser but can be rendered.
 normaliseParams ($image, &$params)
 rasterize ($srcPath, $dstPath, $width, $height)
 Transform an SVG file to PNG This function can be called outside of thumbnail contexts.
 unpackMetadata ($metadata)
 visibleMetadataFields ()
 Get a list of metadata items which should be displayed when the metadata table is collapsed.

Static Public Member Functions

static rasterizeImagickExt ($srcPath, $dstPath, $width, $height)

Public Attributes

const SVG_METADATA_VERSION = 2

Detailed Description

Handler for SVG images.

Definition at line 14 of file SVG.php.


Member Function Documentation

SvgHandler::doTransform ( image,
dstPath,
dstUrl,
params,
flags = 0 
)
Parameters:
$imageFile
$dstPath
$dstUrl
$params
int$flags
Returns:
bool|MediaTransformError|ThumbnailImage|TransformParameterError

Reimplemented from MediaHandler.

Definition at line 88 of file SVG.php.

References normaliseParams(), rasterize(), wfMkdirParents(), and wfMsg().

Here is the call graph for this function:

Parameters:
$fileFile
Returns:
array|bool

Reimplemented from MediaHandler.

Definition at line 253 of file SVG.php.

References $file, $result, MediaHandler\addMeta(), unpackMetadata(), and visibleMetadataFields().

Here is the call graph for this function:

SvgHandler::getImageSize ( file,
path,
metadata = false 
)
Parameters:
$fileFile
$path
bool$metadata
Returns:
array

Definition at line 185 of file SVG.php.

References $file.

Parameters:
$fileFile
Returns:
string

Reimplemented from ImageHandler.

Definition at line 205 of file SVG.php.

References $file, $wgLang, and wfMsgExt().

Here is the call graph for this function:

SvgHandler::getMetadata ( image,
path 
)

Get handler-specific metadata which will be saved in the img_metadata field.

Parameters:
$imageFile: the image object, or false if there isn't one. Warning, FSFile::getPropsFromPath might pass an (object)array() instead (!)
$pathString: the filename
Returns:
String

Reimplemented from MediaHandler.

Definition at line 213 of file SVG.php.

References SVG_METADATA_VERSION, and wfDebug().

Here is the call graph for this function:

Get a string describing the type of metadata, for display purposes.

Returns:
string

Reimplemented from MediaHandler.

Definition at line 236 of file SVG.php.

SvgHandler::getThumbType ( ext,
mime,
params = null 
)

Get the thumbnail extension and MIME type for a given source MIME type.

Returns:
array thumbnail extension and MIME type

Reimplemented from MediaHandler.

Definition at line 197 of file SVG.php.

Parameters:
$fileFile
Returns:
bool

Reimplemented from ImageHandler.

Definition at line 39 of file SVG.php.

References $file, and unpackMetadata().

Here is the call graph for this function:

False if the handler is disabled for all files.

Reimplemented from MediaHandler.

Definition at line 17 of file SVG.php.

References $wgSVGConverter, $wgSVGConverters, and wfDebug().

Here is the call graph for this function:

SvgHandler::isMetadataValid ( image,
metadata 
)

Check if the metadata string is valid for this handler.

If it returns MediaHandler::METADATA_BAD (or false), Image will reload the metadata from the file and update the database. MediaHandler::METADATA_GOOD for if the metadata is a-ok, MediaHanlder::METADATA_COMPATIBLE if metadata is old but backwards compatible (which may or may not trigger a metadata reload).

Reimplemented from MediaHandler.

Definition at line 240 of file SVG.php.

References unpackMetadata().

Here is the call graph for this function:

The material is vectorized and thus scaling is lossless.

Reimplemented from MediaHandler.

Definition at line 31 of file SVG.php.

True if handled types cannot be displayed directly in a browser but can be rendered.

Reimplemented from MediaHandler.

Definition at line 27 of file SVG.php.

SvgHandler::normaliseParams ( image,
&$  params 
)
Parameters:
$imageFile
$params
Returns:
bool

Reimplemented from ImageHandler.

Definition at line 56 of file SVG.php.

References $wgSVGMaxSize, and File\scaleHeight().

Referenced by doTransform().

Here is the call graph for this function:

Here is the caller graph for this function:

SvgHandler::rasterize ( srcPath,
dstPath,
width,
height 
)

Transform an SVG file to PNG This function can be called outside of thumbnail contexts.

Parameters:
string$srcPath
string$dstPath
string$width
string$height
Returns:
true|MediaTransformError

Definition at line 124 of file SVG.php.

References $wgSVGConverter, $wgSVGConverterPath, $wgSVGConverters, MediaHandler\removeBadFile(), wfDebug(), wfDebugLog(), wfEscapeShellArg(), wfHostname(), wfProfileIn(), wfProfileOut(), and wfShellExec().

Referenced by doTransform().

Here is the call graph for this function:

Here is the caller graph for this function:

static SvgHandler::rasterizeImagickExt ( srcPath,
dstPath,
width,
height 
) [static]

Definition at line 165 of file SVG.php.

SvgHandler::unpackMetadata ( metadata)

Definition at line 225 of file SVG.php.

References wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by formatMetadata(), isAnimatedImage(), and isMetadataValid().

Here is the call graph for this function:

Here is the caller graph for this function:

Get a list of metadata items which should be displayed when the metadata table is collapsed.

Returns:
array of strings
Access:
protected

Reimplemented from MediaHandler.

Definition at line 244 of file SVG.php.

Referenced by formatMetadata().

Here is the caller graph for this function:


Member Data Documentation

Definition at line 15 of file SVG.php.

Referenced by getMetadata().


The documentation for this class was generated from the following file: