MediaWiki REL1_33
ResourceLoaderImageTestable Class Reference
Inheritance diagram for ResourceLoaderImageTestable:
Collaboration diagram for ResourceLoaderImageTestable:

Public Member Functions

 massageSvgPathdata ( $svg)
 Massage the SVG image data for converters which don't understand some path data syntax.
 
 rasterize ( $svg)
 Convert passed image data, which is assumed to be SVG, to PNG.
 
- Public Member Functions inherited from ResourceLoaderImage
 __construct ( $name, $module, $descriptor, $basePath, $variants, $defaultColor=null)
 
 getDataUri (ResourceLoaderContext $context, $variant, $format)
 Get the data: URI that will produce this image.
 
 getExtension ( $format='original')
 Get the extension of the image.
 
 getImageData (ResourceLoaderContext $context, $variant=false, $format=false)
 Get actual image data for this image.
 
 getMimeType ( $format='original')
 Get the MIME type of the image.
 
 getModule ()
 Get name of the module this image belongs to.
 
 getName ()
 Get name of this image.
 
 getPath (ResourceLoaderContext $context)
 Get the path to image file for given context.
 
 getUrl (ResourceLoaderContext $context, $script, $variant, $format)
 Get the load.php URL that will produce this image.
 
 getVariants ()
 Get the list of variants this image can be converted to.
 
 sendResponseHeaders (ResourceLoaderContext $context)
 Send response headers (using the header() function) that are necessary to correctly serve the image data for this image, as returned by getImageData().
 

Additional Inherited Members

- Protected Member Functions inherited from ResourceLoaderImage
 variantize ( $variantConf, ResourceLoaderContext $context)
 Convert this image, which is assumed to be SVG, to given variant.
 
- Static Protected Attributes inherited from ResourceLoaderImage
static array $fileTypes
 Map of allowed file extensions to their MIME types.
 

Detailed Description

Definition at line 127 of file ResourceLoaderImageTest.php.

Member Function Documentation

◆ massageSvgPathdata()

ResourceLoaderImageTestable::massageSvgPathdata (   $svg)

Massage the SVG image data for converters which don't understand some path data syntax.

This is necessary for rsvg and ImageMagick when compiled with rsvg support. Upstream bug is https://bugzilla.gnome.org/show_bug.cgi?id=620923, fixed 2014-11-10, so this will be needed for a while. (T76852)

Parameters
string$svgSVG image data
Returns
string Massaged SVG image data

Reimplemented from ResourceLoaderImage.

Definition at line 129 of file ResourceLoaderImageTest.php.

◆ rasterize()

ResourceLoaderImageTestable::rasterize (   $svg)

Convert passed image data, which is assumed to be SVG, to PNG.

Parameters
string$svgSVG image data
Returns
string|bool PNG image data, or false on failure

Reimplemented from ResourceLoaderImage.

Definition at line 133 of file ResourceLoaderImageTest.php.


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