mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-15 04:24:28 +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
|
struct SvgImageNode
|
||||||
{
|
{
|
||||||
float x;
|
float x, y, w, h;
|
||||||
float y;
|
|
||||||
float w;
|
|
||||||
float h;
|
|
||||||
string *href;
|
string *href;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -269,6 +269,11 @@ string svgUtilURLDecode(const char *src)
|
||||||
|
|
||||||
char a, b;
|
char a, b;
|
||||||
while (*src) {
|
while (*src) {
|
||||||
|
if (*src <= 0x20) {
|
||||||
|
++src;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (*src == '%' &&
|
if (*src == '%' &&
|
||||||
((a = src[1]) && (b = src[2])) &&
|
((a = src[1]) && (b = src[2])) &&
|
||||||
(isxdigit(a) && isxdigit(b))) {
|
(isxdigit(a) && isxdigit(b))) {
|
||||||
|
@ -293,6 +298,11 @@ string svgUtilBase64Decode(const char *src)
|
||||||
decoded.reserve(3*(1+(length >> 2)));
|
decoded.reserve(3*(1+(length >> 2)));
|
||||||
|
|
||||||
while (*src && *(src+1)) {
|
while (*src && *(src+1)) {
|
||||||
|
if (*src <= 0x20) {
|
||||||
|
++src;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
auto value1 = _base64Value(src[0]);
|
auto value1 = _base64Value(src[0]);
|
||||||
auto value2 = _base64Value(src[1]);
|
auto value2 = _base64Value(src[1]);
|
||||||
decoded += (value1 << 2) + ((value2 & 0x30) >> 4);
|
decoded += (value1 << 2) + ((value2 & 0x30) >> 4);
|
||||||
|
|
Loading…
Add table
Reference in a new issue