Hi
I have made a database with castle db and want to load the images from there into my game. I get the base64 string from the image i need and want to transform it to a PoolByteArray with the base64_to_raw() method. Here i get the following error:
ERROR: base64_to_raw: Condition "CryptoCore::b64_decode(&w[0], buf.size(), &arr_len, (unsigned char *)cstr.get_data(), strlen) != OK" is true. Returned: PoolVector<uint8_t>()
Code:
func set_icon(data):
icon = data["icon"]
var data_read2 = File.new()
data_read2.open("res://Items/new.img", File.READ)
var data2 = parse_json(data_read2.get_as_text())
data_read2.close()
var split = data2[icon].split(",", true, 1)
var base64_string = split[1]
var byte_pool = Marshalls.base64_to_raw(base64_string)
#print(base64_string)
var i = Image.new()
i.load_png_from_buffer(byte_pool)
var t = ImageTexture.new()
t.create_from_image(i)
sprite.texture = t
I hope somebody can solve my problem.