Development environment
Unity2022.3.19f
MacOS Sonoma 14.5
Download and save a png image with a resolution of 4096 x 2048 using
When I open the downloaded image in the Finder on my Mac, the message ‘Cannot preview’ appears.
How can I save it successfully?
Please help!
UnityWebRequest request = UnityWebRequestTexture.GetTexture(url));
yield return request.SendWebRequest();
if (request.result == UnityWebRequest.Result.Success)
{
tempTexture.LoadImage(request.downloadHandler.data);
tempTexture.Apply();
File.WriteAllBytes(path, tempTexture.EncodeToPNG());
}