The Problem
The base64encoding does not work in blobs returned from the camera or photo gallery
The Code
var win = Ti.UI.createWindow();
win.open();
Titanium.Media.showCamera({
success:function(event){
var image = event.media;
var width = event.width;
var height = event.height;
Ti.API.info(image);
var encodedImage = Ti.Utils.base64encode(image);
Ti.API.info('encodedImage = '+encodedImage);
},
cancel:function(){
},
error:function(error){
},
saveToPhotoGallery:true,
allowEditing:true,
mediaTypes:[Ti.Media.MEDIA_TYPE_VIDEO,Ti.Media.MEDIA_TYPE_PHOTO]
});
To Reproduce
1. Run this code in app.js, preferably in a device.
2. Open DDMS
3. Look for the "encodedImage" log and copy the encoded image
4. Paste it in a [base64 decoder](
http://www.opinionatedgeek.com/dotnet/tools/base64decode/) and see if it's valid
Trace log from the code above:
Marking as invalid. The log only shows the first section go the base 64 encoded image.
Closing ticket as invalid.