2

I'm developing and iOS app for iPad and I'm using a Repository called Grabkit in order to get images from different services like Instagram and Flicker in addition to images from the Camera Roll. The problem is that when the user selects a picture from the roll I get and URL such this: assets-library://asset/asset.JPG?id=DCFB9E49-93AA-49E3-89C8-2EE64AE2C4C6&ext=JPG I've tried some codes to get the image from this kind of paths but no one has worked, such as the following:

 ALAssetsLibrary* library = [[ALAssetsLibrary alloc] init];

    // Ask for the "Asset" for the URL. An asset is a representation of an image in the Photo application.
    [library assetForURL:originalImage.URL
             resultBlock:^(ALAsset *asset) {

                 // Here, we have the asset, let's retrieve the image from it

                 CGImageRef imgRef = [[asset defaultRepresentation] fullResolutionImage];
                 /* Instead of the full res image, you can ask for an image that fits the screen
                  CGImageRef imgRef  = [[asset defaultRepresentation] fullScreenImage];
                  */

                 // From the CGImage, let's build an UIImage
               imatgetemporal = [UIImage imageWithCGImage:imgRef];


             } failureBlock:^(NSError *error) {

                 // Something wrong happened.

             }];

Is something in my code wrong? Must I try another code?

Marti Serra Vivancos
  • 1,195
  • 5
  • 17
  • 33
  • This should help http://stackoverflow.com/questions/3837115/display-image-from-url-retrieved-from-alasset-in-iphone – zimmryan Jul 11 '13 at 16:50
  • I'm also using Grabkit and I have a similar problem as you can see here (http://stackoverflow.com/questions/17530222/uiimage-from-grkphoto-using-alasset). I also found the answer that @zimmryan suggests but it didn't work. – IOS_DEV Jul 15 '13 at 18:34
  • Hi please look this link it may be helps you... Here's [a link](http://stackoverflow.com/questions/11011928/asset-library-issue-in-ios-5) – Mahesh Aswathanarayana Oct 01 '13 at 02:11

0 Answers0