Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3679

Picture.SaveToPhotos crash

$
0
0

I’ve been trying to use pic.SaveToPhotos in an iOS app to save a copy of a photo taken with the PicturePicker to the Photos library on the device. Photos read/write access is enabled in the iOS capabilities panel. My device, an iPhone 16 Pro, is using iOS v. 18.1.1; my Xojo version is 2024r3.1. I’ve been following @Javier_Menendez 's example in his blog post so my code in the Selected event of the PicturePicker is nearly identical:

Var d As New Dictionary
d.Value("Latitude") = lastLatitude  // set in the MobileLocation control
d.Value("Longitude") = lastLongitude

Var Location As New Dictionary
Location.Value("Location") = d

pic.Metadata = Location

pic.SaveToPhotos(Picture.Formats.JPEG)

This works successfully about once every 20 times but the vast majority of the time fails on the device with a hard crash out of the app with no error catching. I do not believe it has anything to do with the pic.metadata because I can comment that, and all of the location data, out and the hard crash still occurs. I’ve tried .PNG and .HEIC as formats and the crash still occurs.

Am I missing any stupid mistakes before posting a feedback issue?

2 posts - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 3679

Trending Articles