Titanium Community Questions & Answer Archive

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

I am getting error while opening photogallery.

Hello,

I have added webview.html in current window and on clicking on button of webview.html I call fireevent and in app.js I have write code like this but photo gallery not opening in my app.

code:
var w = Titanium.UI.createWindow({
title:'Modal Window',
url:'photo_gallery.js'
});
w.open({animated:true});

photo_gallery.js :

Titanium.Media.openPhotoGallery({

success:function(event)
{
    var cropRect = event.cropRect;
    var image = event.media;
    var thumbnail = event.thumbnail;

    // set image view
    imageView.image = image;

    Titanium.API.info('PHOTO GALLERY SUCCESS cropRect.x ' + cropRect.x + ' cropRect.y ' + cropRect.y  + ' cropRect.height ' + cropRect.height + ' cropRect.width ' + cropRect.width);

},
cancel:function()
{

},
error:function(error)
{
    alert(error);
},
allowImageEditing:true

});

— asked April 6th 2010 by Vikas Khairnar
  • photogallery
0 Comments

2 Answers

  • same problem, any answers?

    — answered February 1st 2011 by Stan Thompson
    permalink
    1 Comment
    • can you post the complete code in pastie?

      — commented February 1st 2011 by Aaron Saunders
  • Me too, not working.

    Here's my code (in the view that tries to open up..):

    var win = Titanium.UI.currentWindow;
    var popoverView;
    var arrowDirection;

    Titanium.Media.openPhotoGallery({

    success:function(event)
    {
        var cropRect = event.cropRect;
        var image = event.media;
    
        // set image view
        Ti.API.debug('Our type was: '+event.mediaType);
    
        Titanium.API.info('PHOTO GALLERY SUCCESS cropRect.x ' + cropRect.x + ' cropRect.y ' + cropRect.y  + ' cropRect.height ' + cropRect.height + ' cropRect.width ' + cropRect.width);
    
    },
    cancel:function()
    {
    
    },
    error:function(error)
    {
    },
    mediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO]
    

    });

    Actually works on emulator, yet crashes on actual iPhone 4.

    -kristian

    — answered September 27th 2011 by Kristian Luoma
    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.