Questions tagged [phassetslibrary]

17 questions
6
votes
0 answers

Is there a way to speed up fetching PHAsset data like filesize?

We are developing a storage app that, among other things, syncs and backs up photos on the user's device with the cloud. We use the file size and image name together to form a makeshift hash for comparison. The problem we are facing is when users…
3
votes
1 answer

PHAsset CLLocation is not giving location same as photos app

We are fetching the latitude and longitude from PHAsset properties we are using CLGeocoder to reverseGeocodeLocation using following method. CLGeocoder * geoCoder = [CLGeocoder new]; [geoCoder reverseGeocodeLocation:loc…
AppleBee
  • 452
  • 3
  • 16
3
votes
0 answers

iOS Error: Unable to locate resource

I'm playing with Photo library on iOS device. I try to write PHAssetResource to a local file. Sometimes it works sometimes it doesn't and I get an error Error: Unable to locate resource type=photo size={3264,…
LakaLe_
  • 454
  • 1
  • 6
  • 15
2
votes
1 answer

How to move reference of PHAsset from "All Photos"/"Camera Roll" to Specific PHAssetCollection?

I am using OpalImagePickerController to pick images/videos from "All Photos"/"Camera Roll" and it's giving me [PHAsset] which is fine but I wanted to add them to Specific album in Photos app and I am using below code for that: @objc func…
Dharmesh Kheni
  • 71,228
  • 33
  • 160
  • 165
2
votes
0 answers

Swift PHAsset PHAssetChangeRequest add/delete Keywords

I would like to programmatically add/delete keywords from Photos in the Photos Library in an iOS app. I have written and tested the code below to toggle the favorite setting on a given photo but I have not been able to find anything in the…
JohnSF
  • 3,736
  • 3
  • 36
  • 72
2
votes
2 answers

I am trying to fetch asset from local identifier and displaying images in collectionview but it makes scroll jerkiness

I am trying following method to fetch asset from local identifier and displaying it in collection view but scroll become jerky while loading. func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) ->…
technoAndroid
  • 31
  • 2
  • 7
2
votes
2 answers

iOS Photokit - PHAsset pixelWidth and pixelHeight does not match high-resolution image

my company is having a big problem with getting correct size metadata by fetching PHAssets. We have developed an iOS applications that lets customers choose pictures from library, get the size (in pixel) for each of them, calculate coordinates for…
Redarea
  • 21
  • 2
2
votes
1 answer

Fetching Assets using Asset resource failing with error "null"

My application reads photos and videos available in Camera Roll, using PHAssetResource application is fetching the original photo and video data. Below is the code used to retrieve the data from Camera Roll. for (PHAssetResource *resource in…
Manikandan
  • 107
  • 2
  • 12
2
votes
0 answers

Move PHAsset from one Album to Another (Swift)

I want to move a PHAsset from one Album to another album. Here is what I am doing: func saveImage(image: UIImage, album: PhotoAlbum, completion: (PHFetchResult?)->()) { var placeholder: PHObjectPlaceholder? …
Sohil R. Memon
  • 9,404
  • 1
  • 31
  • 57
1
vote
1 answer

Fetch All Photos from Library based on creationDate in Swift [Faster Way?]

I have a UICollectionView displaying library photos based on latest "creationDate". For that I am using below code: struct AssetsData { var creationDate: Date, assetResult: PHFetchResult } func fetchPhotos() -> [AssetsData] { …
Sohil R. Memon
  • 9,404
  • 1
  • 31
  • 57
1
vote
0 answers

Error while writing a video against some apple live images

I'am populating gallery assets in my custom app. In my app, apple live images are considered as videos. I explicitly write a video against apple live image. Some of my apple live images are correctly written as videos while i get error for some of…
1
vote
1 answer

Exclude iCloud shared albums with fetching asset collections

I'm trying to fetch a list of all the albums in the user's photo library excluding any iCloud shared albums. Here is the code I am using so far: PHFetchOptions *userAlbumsOptions = [PHFetchOptions new]; userAlbumsOptions.predicate = [NSPredicate…
mashers
  • 1,009
  • 7
  • 22
1
vote
1 answer

How to save a video to the camera roll and get the asset URL?

I need to export a video from my iOS app and get the asset id. In the past, you can use ALAssetsLibrary: save image in camera roll and get asset url But it's deprecated now. I wonder what would be the new way of achieving this now? Thanks!
Thinium
  • 171
  • 1
  • 14
0
votes
0 answers

Issue adding Apple ProRaw (DNG) files to Photos Library

I am using the code below to import images into a Photos Library. The code works for JPGs and HEICs but when it encounters Apple ProRaw (DNG) files it give the following error messages: Error Domain=PHPhotosErrorDomain…
psb
  • 89
  • 5
0
votes
0 answers

How to dynamically update my gallery data

Hello Respected Comrades, I made a gallery app. initially I get a data of media from phone. but when i add some new photos to device. i cant see them until : re install app fetching in view will appear (this is just a temperory fix) I want to…
1
2