src/Rasterization/Renderers/SVGImageRenderer.php
private function loadImageContent($href)
    {
        $dataPrefix = 'data:';

        // check if $href is data URI
        if (substr($href, 0, strlen($dataPrefix)) === $dataPrefix) {
            $commaPos = strpos($href, ',');
            $metadata = substr($href, 0, $commaPos);
            $content  = substr($href, $commaPos + 1);

            if (strpos($metadata, ';base64') !== false) {
                $content = base64_decode($content);
            }

            return $content;
        }

        return file_get_contents($href);
    }
private function loadImageContent($href)
    {
        $dataPrefix = 'data:';

        // check if $href is data URI
        if (substr($href, 0, strlen($dataPrefix)) === $dataPrefix) {
            $commaPos = strpos($href, ',');
            $metadata = substr($href, 0, $commaPos);
            $content  = substr($href, $commaPos + 1);

            if (strpos($metadata, ';base64') !== false) {
                $content = base64_decode($content);
            }

            return $content;
        }

        return file_get_contents($href);
    }
private function loadImageContent ( $ href ) { $ dataPrefix = 'data:' ; // check if $href is data URI if ( substr ( $ href , 0 , strlen ( $ dataPrefix ) ) === $ dataPrefix ) { $ commaPos = strpos ( $ href , ',' ) ; $ metadata = substr ( $ href , 0 , $ commaPos ) ; $ content = substr ( $ href , $ commaPos + 1 ) ; if ( strpos ( $ metadata , ';base64' ) !== false ) { $ content = base64_decode ( $ content ) ; } return $ content ; } return file_get_contents ( $ href ) ; }
Loads the data of an image locatable via the given HREF into a string.

@param string $href The image URI.

@return string The image content.
Loads the data of an image locatable via the given HREF into a string .