Image doesn't show on Android but works in windows

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MrMonk
:warning: Old Version Published before Godot 3 was released.

This damn code doesn’t work on Android but works fine on Windows.
Any ideas ? thanks !

extends Node2D

func _ready():
var img_name = load('bk.jpg').get_data()	
var imgt = ImageTexture.new()	
var mRect2 = Rect2(0,0, 500,500)	
imgt.create_from_image(img_name.get_rect(mRect2))	
var temp = Sprite.new()
temp.set_texture(imgt)
add_child(temp)
:bust_in_silhouette: Reply From: Hinsbart

See #2997 on github, it seems like a limitation of gles2 (can’t get texture data once it’s on the gpu, so get_data() returns an empty image).
The upcoming gles3 renderer will probably fix this.