since Minetest have a http api and can handle the JSON format, I decided to write a library for my skin Db.
If its finished, It should download and save the skin files to the hdd.
As current state everything works great, until I try to fetch the following skin:
http://minetest.fensta.bplaced.net/#!pa ... ,filter:19
the response looks good, and the final png size of it should also look also good (2.8 Kb)
but if I convert the Base64 of the image file I get the error unpack() too many results to unpack.
the function to decode gets called here: https://bitbucket.org/adrido/skindb-dri ... nit.lua-23
and the error happens here:
https://bitbucket.org/adrido/skindb-dri ... 64.lua-281
for the pages 1-11 everything works great, only page 12 makes trouble. (currently I fetching only 1 skin per page, to make debugging easier)
I think its not the file size itself, because Sam_I is 4 Kb big and this works good.
If I overwrite the unpack function to
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
function unpack (t, i)
i = i or 1
if t[i] ~= nil then
return t[i], unpack(t, i + 1)
end
end
it works fine.
Is there a limitation to the unpack() function by minetest? Can it removed or changed somehow?
I found an alternative Base64decoding library, which seems to be pretty fast, but it requires lua 5.2 or a modern version of LuaJit, so I cannot use it.
Will Minetest update lua to Lua 5.2 or 5.3 on some day?