View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0029896||Runner||HTML5||Public||2018-08-09 16:35||2018-08-13 14:15|
|Reporter||Stewart Bishop||Assigned To||Mike Dailly|
|Priority||Low||Severity||C - General||Reproducibility||100%|
|Status||Closed||Resolution||No Change Required|
|Target Version||Fixed in Version|
|Summary||0029896: HTML5: buffer_save() and then sprite_add() silently fails because the browser's localstorage stops this|
|Description||I'm trying to load a base64-encoded image to the game via decoding the base64 string to a buffer, saving it as a .png file and then loading via sprite_add. It works on windows, but on HTML5 it seems like buffer_save silently fails since there is a 404/Not Found message in browser's console log after attempting to load recently saved image back.|
|Steps To Reproduce||1) Run the sample on HTML5|
2) Click anywhere
3) See it fails
|Tags||No tags attached.|
|1.4 Found In|
|2.x Runtime Found In||184.108.40.206|
|2.x Runtime Verified In|
buffersavebug.yyz (44,696 bytes)
Sorry, not a bug.
In HTML5 you can't "save" to a server, as the server needs special upload code, and this is server (and game) specific. Buffer save will go to HTML5 "localstorage" (which each browser has it's own instance of), but even then you can not load a PNG file from localstorage, as these can only come a webserver.
You "could" save a RAW buffer (an X by Y, ARGB byte buffer that's then base 64 encoded, then copy that buffer onto a surface, and then make a sprite from that.
but as it stands, this isn't a bug due to HTML5 limitations.