Three engines to render SVG (Delphi Image32, Skia4Delphi, Direct2D wrapper) and four components to simplify use of SVG images (resize, fixedcolor, grayscale...)
function ParseURI(const URI: string; EmptyOnFail: Boolean): string;
var
S: string;
begin
if EmptyOnFail then
Result := ''
else
Result := URI;
if URI <> '' then
begin
S := Trim(URI);
if (Copy(S, 1, 5) = 'url(#') and (S[Length(S)] = ')') then
Result := Copy(S, 6, Length(S) - 6);
// Remove single quotes
if (Length(Result) > 0) and (Result[1] ='''') and (Result[Length(Result)]='''') then
Result := Copy(Result, 2, Length(Result) - 2);
end;
end;
I have seen svgs with the url enclosed in single quotes e.g.
from https://developer.mozilla.org/en-US/docs/Web/SVG/Element/radialGradient
Pascal SVG does not handle this.
To fix in SVGParse.pas change ParseURI to
Two lines aded.