Questions tagged [alasset]

An ALAsset object represents a photo or a video managed by the Photo application.

215 questions
25
votes
5 answers

ALAssetsLibrary assetForURL: always returning nil for photos in "My Photo Stream" in iOS 8.1

This code worked fine in iOS 7 but in iOS 8.1 all assets located in the "My Photo Stream" album are nil from within the result block. (The failureBlock is not called.) Regular albums and shared albums work just fine. I tried the accepted answer…
taber
  • 3,096
  • 3
  • 43
  • 68
25
votes
1 answer

Access Burst Mode photos in library

I’m trying to access photos in the iOS asset library that the user has taken using Burst Mode. I’m trying using ALAssetsLibrary and filtering photos: - (void)findBurstModePhotos { ALAssetsFilter *allPhotos = [ALAssetsFilter allPhotos]; …
Jeff Kelley
  • 18,594
  • 5
  • 67
  • 80
24
votes
5 answers

Wait for assetForURL blocks to be completed

I would like to wait this code to be executed before to continue but as these blocks are called assynchronously I don't know how to do??? NSURL *asseturl; NSMutableArray *tmpListAsset = [[NSMutableArray alloc] init]; ALAssetsLibrary *library =…
Mathieu
  • 1,165
  • 4
  • 18
  • 34
21
votes
5 answers

How to get an ALAsset URL from a PHAsset?

You can do it sneakily† using the undocumented PHAsset.ALAssetURL property, but I'm looking for something documented. † In Objective-C, this will help @interface PHAsset (Sneaky) @property (nonatomic, readonly) NSURL *ALAssetURL; @end
Clay Bridges
  • 10,746
  • 10
  • 62
  • 110
18
votes
3 answers

How to get a ALAssetRepresentation of a shared photostream ALAsset?

When I try to access pictures from a photo stream, sometimes the [asset defaultRepresentation] method returns nil. According to the documentation this can occur if the asset is not (yet) available locally. This method returns nil for assets from a…
Pieter
  • 16,523
  • 6
  • 47
  • 87
14
votes
2 answers

Get video NSData from ALAsset url iOS

I am not able to retrieve NSData from the url that I get from ALAsset Below is the code I tried:- I always get NSData as nil. NSData *webData = [NSData dataWithContentsOfURL:[asset defaultRepresentation].url]; I also tried something like this …
Ekra
  • 2,941
  • 8
  • 36
  • 60
13
votes
2 answers

Generating custom thumbnail from ALAssetRepresentation

My main problem is i need to obtain a thumbnail for an ALAsset object. I tried a lot of solutions and searched stack overflow for days, all the solutions i found are not working for me due to these constraint: I can't use the default thumbnail…
Scakko
  • 548
  • 6
  • 17
12
votes
6 answers

Getting video from ALAsset

Using the new asset library framework available in iOS 4 i see that I can get the url for a given video using the UIImagePickerControllerReferenceURL. The url returned is in the following…
Rich Dominelli
  • 905
  • 1
  • 7
  • 18
11
votes
4 answers

How to check if an ALAsset still exists using a URL

I've got an array containing ALAsset urls (not full ALAsset objects) So each time I start my application I want to check my array to see if it's still up to date... So I tried NSData *assetData = [[NSData alloc]…
Mathieu
  • 1,165
  • 4
  • 18
  • 34
11
votes
3 answers

Getting the path of an ALAsset

How can I get the path of each item in an array of ALAssets? I would like to get the images so that I can add them to an email e.g. NSString *path = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"png"]; NSData *myData = [NSData…
some_id
  • 28,294
  • 58
  • 173
  • 293
10
votes
1 answer

ALAssetsLibrary - crash after receiving ALAssetsLibraryChangedNotification

Part of my app has a photo browser, somewhat similar to Apple's Photos app, with an initial view controller to browse photo thumbnails and a detail view that's shown when you tap on a photo. I'm using ALAssetsLibrary to access photos, and I pass an…
Jim Rhoades
  • 3,168
  • 3
  • 31
  • 50
9
votes
4 answers

Access a single image with ALAssetsLibrary

Allow me to preface this by saying this is my first time using the ALAssetsLibrary. I need to access the most recent photo in the user's saved photo gallery. It seems that to do this, I have to create an ALAssetsLibrary instance and iterate over…
Jacob
  • 926
  • 1
  • 14
  • 25
8
votes
4 answers

How do I get a thumbnail or saveable path from UIImagePickerController to use for a UIImageView?

Could somebody please explain or show some sample code of how I can use get a thumbnail to be put into a UIImageView after the user selects a photo with UIImagePickerController? Let's say I want to set a thumbnail as the image of a table view cell.…
8
votes
4 answers

How do I create a valid CGImageSourceRef from an ALAssetRepresentation?

I'm trying to use CGImageSourceCreateThumbnailAtIndex to efficiently create a resized version of an image. I have some existing code that does this with images from disk, and now I'm trying to use an image that comes from ALAssetsLibrary. Here's my…
BJ Homer
  • 47,750
  • 10
  • 111
  • 128
8
votes
1 answer

Properly crop an image obtained from the photo library

I've been working on this all day, and have looked at lots of questions here on SO and google, but so far I can't come up with anything quite right. I have taken a photo on an iPad running iOS 5.1.1 and cropped it using the Photos app. I then get a…
lnafziger
  • 25,572
  • 8
  • 58
  • 99
1
2 3
14 15