I have a byte[] array which reads a local file and then I assign it to a unity Texture2D. The image is assigned using the im.sprite = Sprite.Create() function.
The problem I have is that I need to detect the width and height of the image from the byte array so I can adjust adjust the texture size and avoid image stretching on the unity scene at run-time.
Do you know how I could use a library or function of some kind to maybe create a temp image from the image byte array and then see the desired width and height before I create the sprite and apply the texture?
I've found solutions in Java but can't seen to get it working by adapting in c#.