Image not load in android device.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Shailesh dhaduk

Godot version:
Godot 3.1

Build in Android device

I get image from http url after set textureRect texture,
Refer this one: https://forum.godotengine.org/40181/unpackaged-images-question?show=40229#a40229

In mac simulator work fine, but build in android devices, it’s set blank(Black colour)
image

I also try image.save_png()
save image /data/data/Com.fan.demo/files/
but set texture is blank.

What need configuration for android?, Give me some help.

did you enable Internet permission?

volzhs | 2019-06-13 12:25

Sorry for delay,
Yes i enable access network status, Internet, also read-write External storage.
But now still blank image set in android device.

Shailesh dhaduk | 2019-07-15 12:40

use gles 2 instead of gles 3

supper_raptor | 2020-03-20 09:33

:bust_in_silhouette: Reply From: lamelynx

I had some trouble when loading image.

You may need to insert a delay before loading the texture:

    var image = Image.new()
    var error = image.load_jpg_from_buffer(img_buffer)
    yield(get_tree(), "idle_frame")    <--- IMPORTANT!
    var texture = ImageTexture.new()
    texture.create_from_image(image, 0)
    get_node("TextureRect").texture = texture