-
Notifications
You must be signed in to change notification settings - Fork 10
/
README
55 lines (47 loc) · 1.52 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
ALAsset Module for Appcelerator Titanium
======================
DESCRIPTION
=======================
With this module you get access to the ALAsset framework.
This means, you can list all images (videos are not supported yet) from the users camera roll.
The default asset group is "ALAssetsGroupSavedPhotos" which has all camera roll photos.
To change the group set the parameter "group" to one of these values:
"savedPhotos" => All saved photos
"photoStream" => The users photo stream
"faces" => faces synced from iTunes
"all" => All photos
As the assets will get enumerated asynchronous, you have to define a "load" callback, which returns an object with the following properties:
image: TiBlob object containing the large image
thumbnail: TiBlob object containing the image thumbnail
index: current index
Everything is licensed under MIT
USAGE
========================
var module = require('de.marcelpociot.assetlibrary');
Ti.API.info("module is => " + module);
module.assets({
group: "all",
assetCallback: function(e){
var image = e.image;
var thumbnail = e.thumbnail;
var index = e.index;
var meta = e.meta;
var view = Ti.UI.createImageView({
image: thumbnail,
top: 0,
left: (index * 50),
width: 50,
height: 50,
exif: meta.exif,
location: meta.location,
});
window.add(view);
}
});
TODO
========================
There is currently no access to asset groups or videos.
ABOUT THE AUTHOR
========================
I'm a web enthusiast located in germany.
Follow me on twitter: @marcelpociot