Skip to content Skip to sidebar Skip to footer

Phonegap Camera Not Loading Image Into Tag

I am trying to use the navigator.camera object to capture an image and push it into an img tag. I am doing what the demo says in the phonegap docs like this: if(navigator.camera)

Solution 1:

The default destinationType has been changed from DATA_URL to FILE_URI. If you add an option:

destinationType :Camera.DestinationType.DATA_URL

to the options you pass to get picture you will be able to set it as base64 encoded data.

http://docs.phonegap.com/en/1.6.1/cordova_camera_camera.md.html#cameraOptions_options

Solution 2:

content://media/external/images/media/325 is the path to an image, not its actual binary data. You'll need to use the filesystem API to get the contents of the file, base64 encode it, and use that.

Post a Comment for "Phonegap Camera Not Loading Image Into Tag"