Cordova 1.6 getPicture destinationType DATA_URL parameter

369 views
Skip to first unread message

Andy Krier

unread,
Apr 12, 2012, 7:47:52 PM4/12/12
to phon...@googlegroups.com
After upgrading to 1.6 today I noticed that the getPicture function no longer returns a base64 encoded string. I thought the default destinationType was DATA_URL, but after looking through the source it looks like the default is now FILE_URI and no matter what I set the option to, the FILE_URI is always returned. Does anyone know if there is a way to get the base64 back? 

Environment:
iOS 5.1 / iPad

Code:

navigator.camera.getPicture(dojo.hitch(this, "_attachSuccess"), dojo.hitch(this, "_attachFail"), { 
  destinationType: 0,
  correctOrientation: true,
  saveToPhotoAlbum: true
});

Shazron

unread,
Apr 12, 2012, 8:05:49 PM4/12/12
to phon...@googlegroups.com
Bug:
https://github.com/apache/incubator-cordova-ios/blob/master/CordovaLib/Classes/CDVCamera.m#L96

0 || 1 will always be 1.

> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com

henrik.akselsen

unread,
Apr 13, 2012, 5:43:02 AM4/13/12
to phonegap
Nice find, anyone know what to change it to for a quick fix?

On 13 apr, 02:05, Shazron <shaz...@gmail.com> wrote:
> Bug:https://github.com/apache/incubator-cordova-ios/blob/master/CordovaLi...

Shazron

unread,
Apr 13, 2012, 11:23:57 AM4/13/12
to phon...@googlegroups.com
We're releasing 1.6.1 on Monday with this fix. If you want to build it
yourself, you can pull from this branch:
https://github.com/apache/incubator-cordova-ios/tree/1.6.1
(you can see how it is patched from the fix commit)

Andy Krier

unread,
Apr 16, 2012, 8:39:50 PM4/16/12
to phon...@googlegroups.com
Thanks for the reply. I thought I was going crazy. Looking forward to 1.6.1


>> > For more options, visit this group at
>> >http://groups.google.com/group/phonegap?hl=en?hl=en
>>
>> > For more info on PhoneGap or to download the code go towww.phonegap.com
>
> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to

Andy Krier

unread,
Apr 17, 2012, 8:53:43 PM4/17/12
to phon...@googlegroups.com
Hey Shazron,

I download the 1.6.1 Branch, built and installed, but now I'm getting this error whenever I try to call navigator.camera.getPicture.

*** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSRangeException> *** -[JKArray objectAtIndex:]: index (11) beyond bounds (11)


Maybe there's a new bug??? Any help would be greatly appreciated.

Andy Krier

unread,
Apr 17, 2012, 9:06:27 PM4/17/12
to phon...@googlegroups.com
Take it back . . . it's working now. Thank you for all of your help.
Reply all
Reply to author
Forward
0 new messages