Questions tagged [phasset]

A `PHAsset` is an object in the iOS Photos Framework (aka PhotoKit) that represents an image or video file on the iOS device.

A PHAsset object represents an image or video file that appears in the Apple Photos app, including iCloud Photos content.

To display or edit assets, use the PHAsset class to fetch asset objects for the photos or videos you want to work with. An asset object is immutable and contains only the metadata for the photo or video it represents.

For more detailed info: https://developer.apple.com/documentation/photokit/phasset

451 questions
0
votes
0 answers

Memory Issue when accessing photos from phone gallery

how to reduce the quality of PHAsset images and retrieve back the original size of the image, since it takes a lot of memory? PHImageManager *manager = [PHImageManager defaultManager]; __block UIImage *ima; for (PHAsset *asset in phAssets) { //…
jeremy gv
  • 77
  • 1
  • 10
0
votes
1 answer

Get images without using ImagePickerController

I have been trying to get gallery photos without using UIImagePickerController though PHAsset ..When I get images from PHAsset its takes a lot of memory ..Is there any other way to get photos without using PHAsset Library
jeremy gv
  • 77
  • 1
  • 10
0
votes
2 answers

How to handle multiple images with large size?

I have list of selected images from Photos gallery. The array list contain selected PHAssets from Photos 768AD8BA-FE7A-4EE9-B2CF-4DD4AEBE2AE9/L0/001 mediaType=1/0, sourceType=1, (2448x3264), creationDate=2016-03-11 06:50:09…
Mitesh Dobareeya
  • 970
  • 1
  • 11
  • 36
0
votes
1 answer

requestImageDataForAsset is failed, when we request for PHAsset in iPhone sdk?

I am using the photos framework on iOS9.2 and we requesting the image data for the PHAsset using requestImageDataForAsset method, Most of the time it works, but some time its imageData is nil, in case of when we request for large video duration…
vijay
  • 1,235
  • 1
  • 11
  • 32
0
votes
1 answer

Save a PHAsset in Core Data?

I have a custom image picker where I load all the images in my photo library. I am wanting to save those image locations in coredata. I have successfully gotten the file path, but when I try to load that I get a permission issue. How do I store a…
linuxer
  • 523
  • 2
  • 4
  • 22
0
votes
1 answer

Image data from PHImageManager differs from image data saved as asset

Hi and thanks in advance for taking the time to look at my question. I'm creating a bitmap and then building a PNG from that bitmap. Then I'm saving that PNG to a photo album. After fetching that asset back via its local identifier, and then using a…
JoeFlow
  • 3
  • 4
0
votes
1 answer

How can I give a flag to PHAsset?

I want to mark a video as uploaded when I upload that to server. I am using Photos framework to fetch videos from a PHCollection. I can't find a way to mark video as uploaded so that I can distinguish between both the types of videos uploaded and…
Vikas
  • 914
  • 7
  • 19
0
votes
1 answer

Move/copy PHAsset from one album to another

I want to move an asset from one album to another. But I could only find information on creating and deleting assets. The reason I want to move instead of creating a new one and deleting the old copy is, I want to preserve the bits of data like the…
Isuru
  • 30,617
  • 60
  • 187
  • 303
0
votes
3 answers

Retrieve Images Without Running Out Of Memory

I'm attempting to retrieve images from the user's camera roll but I'm encountering an issue where it runs out of memory. I load 50 images at a time, but unfortunately after a few loads it runs out of memory and crashes. I've tried wrapping the…
John Doe
  • 1,609
  • 2
  • 13
  • 22
0
votes
1 answer

Access video using localIdentifier, swift

I want to open a video, for which I have the localIdentifier. I know I can create an AVPlayer like this, let player = AVPlayer(URL: NSURL(fileURLWithPath: path)) Is it possible to open a video by providing its localIdentifier? I am using the video…
Bharat
  • 2,139
  • 2
  • 16
  • 35
0
votes
2 answers

Calculate preferredContentSize based on PHAsset size for a Preview View Controller

I am implementing a 3D Touch preview (peek) view controller to show upon firmly pressing on a PHAsset. The view controller that I return from previewingContext:viewControllerForLocation: simply shows the photo full screen. I'm currently not setting…
Jordan H
  • 52,571
  • 37
  • 201
  • 351
0
votes
0 answers

UIImage PNG conversion failure

I have an array of UIImages I am converting to PNG with UIImagePNGRepresentation. The UIImages are loaded from PHAssets from my photos library. Most convert without a problem, except for a few that will cause it to crash with the message: fatal…
noizybrain
  • 155
  • 1
  • 15
0
votes
1 answer

Displaying thumbnail after photo shoot in Swift 2

When trying to load and display a thumbnail of a photo which was just taken like this: func photom(){ if let videoConnection = self.stillImageOutput.connectionWithMediaType(AVMediaTypeVideo) { …
HansiOber
  • 317
  • 2
  • 13
0
votes
2 answers

Using PHImageManager in swift (requestAVAssetForVideo)

I am using an objective-c image picker image picker to pick a time lapse but I am doing it in swift. I only had access to the objective-c code so I used a objective-c to swift converter and I have an error. func…
Tom Fox
  • 897
  • 3
  • 14
  • 34
0
votes
1 answer

Exception using NSPredicate with the Photos Framework : Define -[NSFunctionExpression constantValue]!

The following code throws an NSInvalidArgumentException on the call to fetchAssetsWithOptions: PHFetchOptions *allPhotosOptions = [[PHFetchOptions alloc] init]; allPhotosOptions.sortDescriptors = @[[NSSortDescriptor…
Alan M
  • 98
  • 8