I try to load image from url.
My code looks like (c++):
extern "C" void loadImageSync(const char *url, const char *fileName)
{
    emscripten_wget(url, fileName);
}
This work, but with -s ASYNCFY=1 size of result JS file become ~130mb (It 
was ~3mb before). This is too heavy for me and I try to use 
emscripten_async_wget and emscripten_sleep/emscripten_sleep_with_yield like:
loadImage_fileLoaded = false;
emscripten_async_wget(url, fileName, &loadImage_onLoad, &loadImage_onError);
while (!loadImage_fileLoaded) {
    emscripten_sleep(10);
}
And this not work. I try to use -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1 
and get error about "add functions to whitelist" -- but as far as I 
understand, this link flags add everything to whitelist.

Error message:
This error happened during an emterpreter-async save or load of the stack. 
Was there non-emterpreted code on the stack during save (which is 
unallowed)? You may want to adjust EMTERPRETIFY_BLACKLIST, 
EMTERPRETIFY_WHITELIST.
Ok, lets add this (that listed in stacktrace) functions to whitelist. But 
at any added function I get undefined error.
What I need to do? How to load image sync and safe ~small size of file?

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to