includes/ImageFunctions.php File Reference

Go to the source code of this file.

Classes

class  XmlSizeFilter

Functions

 wfScaleSVGUnit ($length, $viewportSize=512)
 Return a rounded pixel equivalent for a labeled CSS/SVG length.
 wfGetSVGsize ($filename)
 Compatible with PHP getimagesize().
 wfIsBadImage ($name, $contextTitle=false)
 Determine if an image exists on the 'bad image list'.
 wfFitBoxWidth ($boxWidth, $boxHeight, $maxHeight)
 Calculate the largest thumbnail width for a given original file size such that the thumbnail's height is at most $maxHeight.


Function Documentation

wfFitBoxWidth ( boxWidth,
boxHeight,
maxHeight 
)

Calculate the largest thumbnail width for a given original file size such that the thumbnail's height is at most $maxHeight.

Parameters:
$boxWidth Integer Width of the thumbnail box.
$boxHeight Integer Height of the thumbnail box.
$maxHeight Integer Maximum height expected for the thumbnail.
Returns:
Integer.

Definition at line 182 of file ImageFunctions.php.

Referenced by ImageHandler::normaliseParams(), and ImageFunctionsTest::testFitBoxWidth().

wfGetSVGsize ( filename  ) 

Compatible with PHP getimagesize().

Todo:
support gzipped SVGZ

check XML more carefully

sensible defaults

Parameters:
$filename String: full name of the file (passed to php fopen()).
Returns:
array

Definition at line 98 of file ImageFunctions.php.

References $filename, and $filter.

Referenced by SvgHandler::getImageSize().

wfIsBadImage ( name,
contextTitle = false 
)

Determine if an image exists on the 'bad image list'.

The format of MediaWiki:Bad_image_list is as follows: * Only list items (lines starting with "*") are considered * The first link on a line must be a link to a bad image * Any subsequent links on the same line are considered to be exceptions, i.e. articles where the image may occur inline.

Parameters:
$name string the image name to check
$contextTitle Title: the page on which the image occurs, if known
Returns:
bool

Definition at line 122 of file ImageFunctions.php.

References $bad, $exceptions, $i, $name, $title, Title::newFromText(), wfMsgForContentNoTrans(), wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by ImageGallery::toHTML().

wfScaleSVGUnit ( length,
viewportSize = 512 
)

Return a rounded pixel equivalent for a labeled CSS/SVG length.

http://www.w3.org/TR/SVG11/coords.html#UnitIdentifiers

Parameters:
$length String: CSS/SVG length.
$viewportSize,: Float optional scale for percentage units...
Returns:
float: length in pixels

Definition at line 10 of file ImageFunctions.php.

Referenced by XmlSizeFilter::filter().


Generated on Sat Sep 5 02:08:07 2009 for MediaWiki by  doxygen 1.5.9