mirror of
https://github.com/syoyo/tinygltf.git
synced 2026-09-14 06:18:27 +00:00
Support plain text data URIs
This commit is contained in:
@@ -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<unsigned char> *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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user