453 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
-1
votes
2
answers
126
views
PHAsset.fetchAssets(withLocalIdentifiers with same order
let results: [PHPickerResult] = [1, 2, 3]
let identifiers = request.results.compactMap(\.assetIdentifier) // [1, 2, 3]
let fetchResult = PHAsset.fetchAssets(withLocalIdentifiers: identifiers, options: ...
2
votes
0
answers
61
views
MacOS SwiftUI App not going through Photos Permissions Flow Properly
I'm building a MacOS SwiftUI app that needs to get access to the Photos library. I'm setting the value in the Info.plist:
As well as file access in the Sandbox settings:
struct PhotosPermissionView: ...
1
vote
0
answers
118
views
Swift faster way to retrieve exif data from PHAsset
I'm working on a photos app on iOS, where I have to extract the camera information of user's photos for displaying.
The problem I am facing is that the process turns out to be extremely slow and ...
0
votes
0
answers
187
views
Swift wait for requestAVAsset to complete before adding to array
func getAlbumAssets(albumName: String) async -> Array {
var albumAssets: [AlbumAsset] = [AlbumAsset]()
var albumAssetsResult = PHFetchResult<AnyObject>()
let fetchOptions = PHFetchOptions()
...
4
votes
0
answers
145
views
How to calculate size of files stored in device faster while using "PHAsset"
I have an array of PHAsset (Let's say, array size is greater than 50,000), and I want to know the file size of each PHAsset. I'm trying it using PHAssetResource.assetResources but it is taking much ...
1
vote
0
answers
101
views
Export Video PHAsset to NSData with GPS metadata
I am trying to convert a video PHAsset to NSData for upload, but each attempt to save the data of the asset seems to lose the location metadata. Here is what I have tried:
Get the AVAsset from PHAsset,...
0
votes
1
answer
389
views
PHAsset Creation date - check if UTC time or not?
When getting CreateionDate of PHAsset, the time returned is in UTC format.
In order to display it correctly, so as to meet user's expectation that e.g. captured image of sunset was in the evening ...
3
votes
1
answer
4k
views
Best way to fetch and display all images from Photos SwiftUI
I have created a way to fetch all photos and display them in a grid within a view. Upon loading the app, all seems fine, everything in the view loads properly and if I scroll through the scrollview, ...
3
votes
0
answers
210
views
How can I jump to Photos app by a specific image's identifier on my App?
This question is similar to how can I show selected image in the Photos app. I'm writing a photo gallery app that loads photos from Photos using PHImageManager.requestImage(), so for a specific low-...
0
votes
1
answer
1k
views
Add metadata to existing image URL without reading image into memory?
For UIImages I am writing images with EXIF/IPTC/etc meta using Photos like:
let dataBundle = mergeImageData(...)
let assetChangeRequest = PHAssetCreationRequest.forAsset()
let assetOptions = ...
1
vote
1
answer
971
views
iOS App Crashes from Memory Issue when Generating Images from PHAssets
I'm trying to get some photos (PHAsset's) from a user's Photos library, and convert them to UIImage's.
Here's the code for fetching the assets from the library:
func fetchPhotos() {
...
0
votes
1
answer
110
views
Split PHAsset to frames swift
I need to split video(PHAsset) to frames. Please could anyone write an extension for PHAsset for example to call function like this:
extension PHAsset {
func getFrame(timecode: Float) -> UIImage?...
1
vote
0
answers
179
views
Swift UI: Building a custom image Guess Who game, struggling to access selected images for my Game view
I'm working on my final large portfolio project and I am attempting to create a Guess Who style game in Swift UI that allows you to upload your own images to create custom character cards. I have ...
-1
votes
1
answer
76
views
Copy written billion+ pixel image to Photos?
My app is successfully writing multi-gigapixel images (many billions of pixels per image).
Is there a way, without reading the image as a UIImage, to add or copy the saved image to Photos?
It's ...
1
vote
0
answers
219
views
PHImageManager requestAVAssetForVideo returns nil assetUrl (iCloud)
After presenting the Library Picker,
Trying to fetch selected video
url some of the assets seems to be stored on iCloud and not locally.
requestAVAssetForVideo not contains AVAsset. how to handle it?
...