mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 20:14:37 +00:00
svg_loader: <image> tag introduced fix #9
Fixed Base64 and utf8 for new line and whitespace Changed tvgSvgLoaderCommon.h to single line convention
This commit is contained in:
parent
28342c5c1f
commit
31f45fbd5f
2 changed files with 11 additions and 4 deletions
|
@ -190,10 +190,7 @@ struct SvgLineNode
|
|||
|
||||
struct SvgImageNode
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float w;
|
||||
float h;
|
||||
float x, y, w, h;
|
||||
string *href;
|
||||
};
|
||||
|
||||
|
|
|
@ -269,6 +269,11 @@ string svgUtilURLDecode(const char *src)
|
|||
|
||||
char a, b;
|
||||
while (*src) {
|
||||
if (*src <= 0x20) {
|
||||
++src;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (*src == '%' &&
|
||||
((a = src[1]) && (b = src[2])) &&
|
||||
(isxdigit(a) && isxdigit(b))) {
|
||||
|
@ -293,6 +298,11 @@ string svgUtilBase64Decode(const char *src)
|
|||
decoded.reserve(3*(1+(length >> 2)));
|
||||
|
||||
while (*src && *(src+1)) {
|
||||
if (*src <= 0x20) {
|
||||
++src;
|
||||
continue;
|
||||
}
|
||||
|
||||
auto value1 = _base64Value(src[0]);
|
||||
auto value2 = _base64Value(src[1]);
|
||||
decoded += (value1 << 2) + ((value2 & 0x30) >> 4);
|
||||
|
|
Loading…
Add table
Reference in a new issue