Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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;
});
— asked May 24th 2010 by Antonio Silveira
  • camera
  • editing
  • photo
0 Comments

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 ..

    — answered May 30th 2010 by Nils
    permalink
    0 Comments
  • Never mind, just tested it on a Device and the allowImageEditing:false
    works fine. With Simulator it doesn't work.

    — answered May 24th 2010 by Antonio Silveira
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.