mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-28 09:05:52 +00:00
svg_loader: <image> tag introduced fix #6
Moved file:// removing into _imageBuildHelper
This commit is contained in:
parent
3e4512a9a6
commit
1f67c1d689
2 changed files with 1 additions and 1 deletions
|
@ -1534,7 +1534,6 @@ static string* _idFromHref(const char* href)
|
||||||
{
|
{
|
||||||
href = _skipSpace(href, nullptr);
|
href = _skipSpace(href, nullptr);
|
||||||
if ((*href) == '#') href++;
|
if ((*href) == '#') href++;
|
||||||
if(!strncmp(href, "file://", sizeof("file://") - 1)) href += sizeof("file://") - 1;
|
|
||||||
return new string(href);
|
return new string(href);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -432,6 +432,7 @@ static unique_ptr<Picture> _imageBuildHelper(SvgNode* node, float vx, float vy,
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
if(!strncmp(href, "file://", sizeof("file://") - 1)) href += sizeof("file://") - 1;
|
||||||
//TODO: protect against recursive svg image loading
|
//TODO: protect against recursive svg image loading
|
||||||
if (picture->load(href) != Result::Success) return nullptr;
|
if (picture->load(href) != Result::Success) return nullptr;
|
||||||
picture->size(node->node.image.w, node->node.image.h);
|
picture->size(node->node.image.w, node->node.image.h);
|
||||||
|
|
Loading…
Add table
Reference in a new issue