I want to know how to how to retrieve a image using URL. I am using the ALAsset. I followed the answer (the one with the tick mark) from the following link display image from URL retrieved from ALAsset in iPhone. How to retrieve the image and upload it?
Have you managed to get the ALAsset? Once you do, getting the image is easy. To get a thumbnail, the asset has a method...thumbnail.
UIImage *img = [UIImage imageWithCGImage:[myAsset thumbnail]];
To get the full Res image you have to go through the default representation.
UIImage *img = [UIImage imageWithCGImage:[[myAsset defaultRepresentation] fullResolutionImage]
Hope this helps
I know this is an old question but just in case anyone else comes I found another method (requires iOS 5+) that returns an easier to work with image:
UIImage *img = [UIImage imageWithCGImage:[[myAsset defaultRepresentation]
fullScreenImage];
From the docs of fullScreenImage
:
In iOS 5 and later, this method returns a fully cropped, rotated, and adjusted image—exactly as a user would see in Photos or in the image picker.
monkybonk05's answer does work, but it not cropped or rotated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With