mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-09 14:13:43 +00:00
Revert "lottie: compatibility++"
This reverts commitc89f6253bf
. No more valid by3f235d9e3f
This commit is contained in:
parent
040de02cef
commit
ccb5a5d1fb
1 changed files with 8 additions and 13 deletions
|
@ -727,22 +727,17 @@ static void _updateImage(LottieGroup* parent, LottieObject** child, float frameN
|
||||||
|
|
||||||
//force to load a picture on the same thread
|
//force to load a picture on the same thread
|
||||||
TaskScheduler::async(false);
|
TaskScheduler::async(false);
|
||||||
auto succeed = false;
|
|
||||||
|
|
||||||
if (image->size > 0) {
|
if (image->size > 0) {
|
||||||
//try all, just in case.
|
if (picture->load((const char*)image->b64Data, image->size, image->mimeType, false) != Result::Success) {
|
||||||
const char* type[] = {image->mimeType, "png", "jpg", "webp"};
|
delete(picture);
|
||||||
for (int i = 0; i < 4; ++i) {
|
return;
|
||||||
if (picture->load((const char*)image->b64Data, image->size, type[i], false) == Result::Success) {
|
}
|
||||||
succeed = true;
|
} else {
|
||||||
break;
|
if (picture->load(image->path) != Result::Success) {
|
||||||
}
|
delete(picture);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
} else if (picture->load(image->path) == Result::Success) succeed = true;
|
|
||||||
|
|
||||||
if (!succeed) {
|
|
||||||
delete(picture);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskScheduler::async(true);
|
TaskScheduler::async(true);
|
||||||
|
|
Loading…
Add table
Reference in a new issue