diff --git a/tiny_gltf_loader.h b/tiny_gltf_loader.h index c499861..d91f665 100644 --- a/tiny_gltf_loader.h +++ b/tiny_gltf_loader.h @@ -716,6 +716,11 @@ static bool IsDataURI(const std::string &in) { return true; } + header = "data:text/plain;base64,"; + if (in.find(header) == 0) { + return true; + } + return false; } @@ -742,6 +747,13 @@ static bool DecodeDataURI(std::vector *out, } } + if (data.empty()) { + header = "data:text/plain;base64,"; + if (in.find(header) == 0) { + data = base64_decode(in.substr(header.size())); + } + } + if (data.empty()) { return false; }