Skip to content

amigoni/titanium-mobile-alasset-module

 
 

Repository files navigation

======================
This module is a Fork of ALAsset Module from mpociot.

It exposes Metadata of each picture. Metadata includes Exif Info as well as GPS info for pictures taken with the iPhone. 
Find out when a picture was taken and where as well as Exposure, Altitude and all kind of other neat info. 

The module currently works in the simulator but seems to crash on device with large amount of pictures. 

Help stabilize it so that it can be used extensively. 

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",
	load: function(e){
		var image 		= e.image;
		var thumbnail	= e.thumbnail;
		var index		= e.index;
		var view		= Ti.UI.createImageView({
			image: thumbnail,
			top: 0,
			left: (index * 50),
			width: 50,
			height: 50
		});
		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

About

Titanium module to get access to the iOS ALAsset framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 66.1%
  • Python 30.7%
  • JavaScript 3.2%