allowImageEditing:false not working properly
Hi I am trying to get an image from Photo Gallery or the camera, but without editing, just the full image.
But when I set the parameter allowImageEditing:false, I can't get the image back, using allowImageEditing:true it works.
Here is a sample code:
//photo preview placeholder
var img = Titanium.UI.createImageView({
img:theImage,
opacity:1
});
viewContainerPhoto.add(img);
// camera button listener
btn_takephoto.addEventListener("click", function(e) {
Titanium.Media.showCamera({
success:function(event) {
handleImageEvent(event);
},
cancel:function() {},
error:function(error) {
var a = Titanium.UI.createAlertDialog({ title:'Uh Oh...'});
if (error.code == Titanium.Media.NO_CAMERA) {
a.setMessage('Sorry, this device does not have a camera - you knew that, right?');
}
else {
a.setMessage('Unexpected error: ' + error.code);
}
a.show();
},
allowImageEditing:false
});
});
function handleImageEvent(event) {
theImage = event.media;
theThumbnail = event.thumbnail;
Ti.App.fireEvent("photoChosen");
}
Ti.App.addEventListener("photoChosen", function(e) {
img.image = theImage;
});
2 Answers
-
Accepted Answer
confirming this.
It is working with the images from 3.1 SDK iPhone simulator (the graduation day images), BUT not with the images from the newer iPhone simulator (the ones with the dog).Fixed it by repacing the new images with the old ones (~/Library/ApplicationSupport/iPhoneSimulator/3.1.3/Media.oldinstall/Photos).
This looks like a memory issue. Might be the newer image have a higher resolution. Quite annoying ..
-
Never mind, just tested it on a Device and the allowImageEditing:false
works fine. With Simulator it doesn't work.