MediaWiki  1.30.2
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. More...
 
 rasterize ( $svg)
 Convert passed image data, which is assumed to be SVG, to PNG. More...
 
- Public Member Functions inherited from ResourceLoaderImage
 __construct ( $name, $module, $descriptor, $basePath, $variants)
 
 getDataUri (ResourceLoaderContext $context, $variant, $format)
 Get the data: URI that will produce this image. More...
 
 getExtension ( $format='original')
 Get the extension of the image. More...
 
 getImageData (ResourceLoaderContext $context, $variant=false, $format=false)
 Get actual image data for this image. More...
 
 getMimeType ( $format='original')
 Get the MIME type of the image. More...
 
 getModule ()
 Get name of the module this image belongs to. More...
 
 getName ()
 Get name of this image. More...
 
 getPath (ResourceLoaderContext $context)
 Get the path to image file for given context. More...
 
 getUrl (ResourceLoaderContext $context, $script, $variant, $format)
 Get the load.php URL that will produce this image. More...
 
 getVariants ()
 Get the list of variants this image can be converted to. More...
 
 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(). More...
 

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. More...
 
- Static Protected Attributes inherited from ResourceLoaderImage
static array $fileTypes
 Map of allowed file extensions to their MIME types. More...
 

Detailed Description

Definition at line 123 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 125 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 129 of file ResourceLoaderImageTest.php.


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