Load Image from local folder on Android not working

Hi, I have a canvas (myCanvas) component, and I try to set this file(DSC06754.JPG about 7 MB, 4912x2760), but it gives me a blue screen, and no errors. With other images it works, but this one that I shoot with my own camera don’t want to show! What can be the problem? I discover that if I resize that to lower resolution than I can see the picture ok.

Here is my code that I use to load image to my canvas:

private IEnumerator LoadPicture(string file)
    WWW www = new WWW("file://" + file);
    yield return www;

This is how it looks:

And if I copy from my computer to Android a picture (Penguins.jpg) and load, it looks ok.


did you find an answear by two years after? I have the same issue

You are probably having problems with android memory, Android memory is very limited so instead of load the texture direcly you will need to resize the image, In case you still want the same size, you will need to make a image loader manager in order to specify the quality, dpi, and others options instead of direct load it into the canvas

this is a unity bug,
i will show u hot to pass this bug

        byte[] bytes = www.GetBytes();//Config.ReadFileByte(path);
//        tex2d = new Texture2D(1,1,TextureFormat.ARGB32,false);
//       do not disable minmap! it importent
        tex2d = new Texture2D(1,1,TextureFormat.ARGB32,true);

        ImageConversion.LoadImage(tex2d, bytes, true);

        sky.SetTexture("_Tex", tex2d);

when the picture size more than 4k and the minmap was disable it will back the blue picture…
i not sure what they happen but this is the reson…

so use my method can load success, but when

1.disable minmap

2.pciture size more than 4k

it still will get a blue pciture…