I’m playing with emscripten to put some oF stuff online. I tried running the ofSystemLoadDialog but it just fails.
I think it’s because that call works only for desktop OS. I’m looking into using the emscripten api directly, but maybe there’s a simpler way? I see a few classes in the ofxEmscripten addon, but I’m not even sure where the emscripten.h file is.
everything you put in the data folder ends up in a kind of virtual file system but that’s all you can access as you would normally do on the desktop. otherwise you need to load form a url which should happen automatically or as you say load the file somehow into js memory through a form or something and share that with c++
Ok, I almost got it now. I created a JS object that allows me to check when a file has been loaded via polling. Then I read it encoded to a base64 string.
I’m able to retrieve this string from c++, and I decode it to an ofBuffer.
Now I’m failing to create an ofImage from the ofBuffer, I get the following:
[ error ] ofImage: loadImage(): couldn't load image from ofBuffer, unable to guess image format from memory`
Can I specify the format somehow? Is there any reason for this besides me doing something wrong with the base64 file?