Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting thumbnails from photos library

I want to save the thumbnails from the iphone photo library, and i want to use them in my application, but not by selecting them, i want it to work automatically. so i run the app, and the thumbnails will appear in the middle of the screen in a scrollable tableview. (5 thumbs in each "page"). Like this: http://cl.ly/0z2m261J2I0B461n2L25

what is the best way to do it? Oh , and of course if a user touch a thumnail the large image will appear in a different view.

like image 547
pricsko Avatar asked Dec 14 '25 14:12

pricsko


1 Answers

  1. Create an ALAssetsLibrary instance.
  2. Send a enumerateGroupsWithTypes:usingBlock:failureBlock: message to your assets library object.
  3. In the block, you are passed an ALAssetsGroup instance over which you again iterate with enumerateAssetsUsingBlock:.
  4. In that block, you get an ALAsset that you can then ask for its thumbnail (a CGImageRef) or its representation (an instance of ALAssetRepresentation), which in turn you can get an image to display from.
like image 83
Ole Begemann Avatar answered Dec 16 '25 19:12

Ole Begemann



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!