/** * Get the data: URI that will produce this image. * * @param ResourceLoaderContext $context Any context * @param string|null $variant Variant to get the URI for * @param string $format Format to get the URI for, 'original' or 'rasterized' * @return string */ public function getDataUri(ResourceLoaderContext $context, $variant, $format) { $type = $this->getMimeType($format); $contents = $this->getImageData($context, $variant, $format); return CSSMin::encodeStringAsDataURI($contents, $type); }