src/Rasterization/Renderers/SVGImageRenderer.php
private function loadImage($href, $w, $h)
    {
        $content = $this->loadImageContent($href);

        if (strpos($content, '<svg') !== false && strrpos($content, '</svg>') !== false) {
            $svg = SVG::fromString($content);
            return $svg->toRasterImage($w, $h);
        }

        return imagecreatefromstring($content);
    }
private function loadImage($href, $w, $h)
    {
        $content = $this->loadImageContent($href);

        if (strpos($content, '<svg') !== false && strrpos($content, '</svg>') !== false) {
            $svg = SVG::fromString($content);
            return $svg->toRasterImage($w, $h);
        }

        return imagecreatefromstring($content);
    }
private function loadImage ( $ href , $ w , $ h ) { $ content = $ this -> loadImageContent ( $ href ) ; if ( strpos ( $ content , '<svg' ) !== false && strrpos ( $ content , '</svg>' ) !== false ) { $ svg = SVG :: fromString ( $ content ) ; return $ svg -> toRasterImage ( $ w , $ h ) ; } return imagecreatefromstring ( $ content ) ; }
Loads the image locatable via the given HREF and creates a GD resource
for it.

This method supports data URIs, as well as SVG files (they are rasterized
through this very library). As such, the dimensions given are the
dimensions the rasterized SVG would have.

@param string $href The image URI.
@param int    $w    The width that the rasterized image should have.
@param int    $h    The height that the rasterized image should have.

@return resource The loaded image.
Loads the image locatable via the given HREF and creates a GD resource for it .