Closed ziadpower closed 4 years ago
Hi
I'm using Unity 2019.2.10f Xcode 11.3.1 iOS 13.3.1
To save an image (Texture2D) to the camera roll on my iPad and I get a confirmation for completion but I can't find the image in my photo gallery.
I've added both permissions on my XCode: NSPhotoLibraryUsageDescription NSPhotoLibraryAddUsageDescription
Here's the script:
public void Save(Texture2D img) { path = Application.platform == RuntimePlatform.Android ? Application.persistentDataPath : Application.streamingAssetsPath; string imagePath = Path.Combine(path,"image.png"); using (var payload = new SavePayload(null,OnSaveCompleted )) { payload.AddImage(img); payload.AddMedia(imagePath); } } void OnSaveCompleted() { result.text="Image saved at\n "+path; }
The first thing to check is that your Texture2D is readable, in other words, if it has pixel data resident in system memory (in addition to graphics memory). Beyond that check the logs for any clues.
Texture2D
Hi
I'm using Unity 2019.2.10f Xcode 11.3.1 iOS 13.3.1
To save an image (Texture2D) to the camera roll on my iPad and I get a confirmation for completion but I can't find the image in my photo gallery.
I've added both permissions on my XCode: NSPhotoLibraryUsageDescription NSPhotoLibraryAddUsageDescription
Here's the script: