Search code examples
titaniumappcelerator

Import all photos from library


I am creating a photo gallery application, and I would like to import all photos from the native gallery of the device in one go. Is there a way to access a list of all the photos? I suppose there must be, since many applications give the option to upload all the photos to the cloud, such as Dropbox.


Solution

  • I don't believe this capability is exposed by Titanium on iOS at the moment. You could show the gallery picker to the user, and let them pick the photos to be uploaded, but that doesn't sound like what you want.

    It sounds like you want to use PHPhotoLibrary to query all of the photos, and then possibly make changes to them. You can either use Hyperloop or write a custom module.

    On Android, I believe it's device dependent, but some cursory exploration suggests the photos are stored commonly on external storage. You could use the Titanium Filesystem APIs to iterate over and find photos.