Post

Replies

Boosts

Views

Activity

LivePhotos taken with iPhone13 cannot be saved in PhotoLibrary of iOS11
LivePhotos taken with iPhone13 cannot be saved on iOS11 iPhone The application incorporates a function to send image data between iPhones and save it to PhotoLibrary on the receiving iPhone side. We receive the image data and save it in PhotoLibrary from the URL where the data is located, following the method on Apple's official website to save LivePhotos in PhotoLibrary. However, when I receive LivePhotos taken by iPhone13 and try to save them in the same way on iPhone7 (iOS11), I get the following error and cannot complete the process "error The operation couldn’t be completed. (Cocoa error -1.)" func saveLivePhotoToPhotosLibrary(stillImageData: Data, livePhotoMovieURL: URL) { PHPhotoLibrary.requestAuthorization { status in guard status == .authorized else { return } PHPhotoLibrary.shared().performChanges({ let creationRequest = PHAssetCreationRequest.forAsset() creationRequest.addResource(with: .photo, data: stillImageData, options: nil) let options = PHAssetResourceCreationOptions() options.shouldMoveFile = true creationRequest.addResource(with: .pairedVideo, fileURL: livePhotoMovieURL, options: options) }) { success, error in // Handle completion. } } } When I send the same LivePhotos data via AirDrop, I also get an error message and cannot migrate it. Does iOS11 not support LivePhotos on the latest iPhones?
0
0
663
Jan ’22
Delegate processing to the image picker does not work.
Since the application cannot detect when the image picker is activated, it uses recursive processing to get the topmost View, and then executes the Delegate process after it is activated. The following code is implemented in our own dialog, and detects the end of the image picker when the user selects "Select Photo". extension DataSelectViewController: UIImagePickerControllerDelegate & UINavigationControllerDelegate {   func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {     Debug.log("image picker - taped Cancel") 		/* Added my process */     picker.dismiss(animated: true, completion: nil)   }   func imagePickerController(_: UIImagePickerController, didFinishPickingMediaWithInfo _: [UIImagePickerController.InfoKey: Any]) {     Debug.log("image picker - taped Done")     /* Added my process */   } } The delegate process may not be executed. What are the possible factors?
0
0
257
Apr ’21
The file “IMG_----.JPG” couldn’t be opened because you don’t have permission to view it
When importing more than 1000 images in iOS9, a few images show "The file "IMG----.JPG" couldn't be opened because you don't have permission to view it. The file "IMG.JPG" couldn't be opened because you don't have permission to view it" appears for a few photos, and they cannot be imported. The images in Photolibrary are retrieved by PHAsset.fetchAssets. In iOS 10.3.3 or later, the same program does not cause this problem. I checked the log to see if the URL or Asset was nil, but I didn't find anything wrong with the images that were successfully loaded. Some of the codes we are getting are listed below. Swift private func _getAssetOption() - PHFetchOptions {     let option = PHFetchOptions()     option.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: true)]     option.includeAssetSourceTypes = .typeUserLibrary     option.includeAllBurstAssets = true     return option }  private func _getAssets() - PHFetchResultPHAsset {     return PHAsset.fetchAssets(with: .image, options: _getAssetOption()) }
2
0
10k
Mar ’21