MediaWiki
master
|
Handler for SVG images. More...
Public Member Functions | |
canAnimateThumb ($file) | |
We do not support making animated svg thumbnails. | |
doTransform ($image, $dstPath, $dstUrl, $params, $flags=0) | |
formatMetadata ($file) | |
getImageSize ($file, $path, $metadata=false) | |
getLongDesc ($file) | |
Subtitle for the image. | |
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 |
SvgHandler::canAnimateThumb | ( | $ | file | ) |
SvgHandler::doTransform | ( | $ | image, |
$ | dstPath, | ||
$ | dstUrl, | ||
$ | params, | ||
$ | flags = 0 |
||
) |
$image | File | |
$dstPath | ||
$dstUrl | ||
$params | ||
int | $flags |
Reimplemented from MediaHandler.
Definition at line 110 of file SVG.php.
References $flags, $params, normaliseParams(), rasterize(), text, wfMessage(), and wfMkdirParents().
SvgHandler::formatMetadata | ( | $ | file | ) |
$file | File |
Reimplemented from MediaHandler.
Definition at line 299 of file SVG.php.
References $file, $name, $result, $value, MediaHandler\addMeta(), array(), as, unpackMetadata(), and visibleMetadataFields().
SvgHandler::getImageSize | ( | $ | file, |
$ | path, | ||
$ | metadata = false |
||
) |
SvgHandler::getLongDesc | ( | $ | file | ) |
Subtitle for the image.
Different from the base class so it can be denoted that SVG's have a "nominal" resolution, and not a fixed one, as well as so animation can be denoted.
$file | File |
Reimplemented from ImageHandler.
Definition at line 233 of file SVG.php.
References $file, $size, $wgLang, global, isAnimatedImage(), and wfMessage().
SvgHandler::getMetadata | ( | $ | image, |
$ | path | ||
) |
Get handler-specific metadata which will be saved in the img_metadata field.
$image | File: the image object, or false if there isn't one. Warning, FSFile::getPropsFromPath might pass an (object)array() instead (!) |
$path | String: the filename |
Reimplemented from MediaHandler.
Definition at line 251 of file SVG.php.
References SVG_METADATA_VERSION, and wfDebug().
SvgHandler::getMetadataType | ( | $ | image | ) |
Get a string describing the type of metadata, for display purposes.
Reimplemented from MediaHandler.
SvgHandler::getThumbType | ( | $ | ext, |
$ | mime, | ||
$ | params = null |
||
) |
Get the thumbnail extension and MIME type for a given source MIME type.
Reimplemented from MediaHandler.
Definition at line 220 of file SVG.php.
References array().
SvgHandler::isAnimatedImage | ( | $ | file | ) |
$file | File |
Reimplemented from MediaHandler.
Definition at line 54 of file SVG.php.
References $file, and unpackMetadata().
Referenced by getLongDesc().
False if the handler is disabled for all files.
Reimplemented from MediaHandler.
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 278 of file SVG.php.
References MediaHandler\METADATA_BAD, MediaHandler\METADATA_COMPATIBLE, MediaHandler\METADATA_GOOD, and unpackMetadata().
SvgHandler::isVectorized | ( | $ | file | ) |
The material is vectorized and thus scaling is lossless.
Reimplemented from MediaHandler.
SvgHandler::mustRender | ( | $ | file | ) |
True if handled types cannot be displayed directly in a browser but can be rendered.
Reimplemented from MediaHandler.
SvgHandler::normaliseParams | ( | $ | image, |
&$ | params | ||
) |
$image | File |
$params |
Reimplemented from ImageHandler.
Definition at line 78 of file SVG.php.
References $params, global, and File\scaleHeight().
Referenced by doTransform().
SvgHandler::rasterize | ( | $ | srcPath, |
$ | dstPath, | ||
$ | width, | ||
$ | height | ||
) |
Transform an SVG file to PNG This function can be called outside of thumbnail contexts.
string | $srcPath | |
string | $dstPath | |
string | $width | |
string | $height |
MWException |
Definition at line 147 of file SVG.php.
References $retval, array(), global, MediaHandler\removeBadFile(), wfDebug(), wfDebugLog(), wfEscapeShellArg(), wfHostname(), wfProfileIn(), wfProfileOut(), and wfShellExec().
Referenced by doTransform().
static SvgHandler::rasterizeImagickExt | ( | $ | srcPath, |
$ | dstPath, | ||
$ | width, | ||
$ | height | ||
) | [static] |
SvgHandler::unpackMetadata | ( | $ | metadata | ) |
Definition at line 263 of file SVG.php.
References wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by formatMetadata(), isAnimatedImage(), and isMetadataValid().
Get a list of metadata items which should be displayed when the metadata table is collapsed.
Reimplemented from MediaHandler.
Definition at line 290 of file SVG.php.
References array().
Referenced by formatMetadata().
const SvgHandler::SVG_METADATA_VERSION = 2 |
Definition at line 30 of file SVG.php.
Referenced by getMetadata().