I am new to PhoneGap and would like to know how to save an in-App image to Photos in iOS.
While I was able to use
navigator.camera.getPicture
with options
quality:50, destinationType:Camera.DestinationType.DATA_URL,saveToPhotoAlbum: true
to save a picture taken with the camera to Photos, I am now trying to find out how to save an in-App image to Photos.
Consider the following PhoneGap - Cordova page where the element myPhoto holds imagedata such as "data:image/jpeg;base64,"...
<html>
<head>
<title>Save Image</title>
<script type="text/javascript" charset="utf-8" src="cordova-2.1.0.js"></script>
<script type="text/javascript" charset="utf-8">
function savePicture(){
//this is where the magic would happen
//how can I save myPhoto to Photos?
//output imageData to a jpg or png file which would show up in Photos?
}
</script>
</head>
<body>
<button onclick="savePicture();">Save Photo</button> <br>
<input type="hidden" name="myPhoto" id="myPhoto" value="">
</body>
</html>
Question:
What should savePicture() do to save the imagedata from myPhoto to Photos in iOS via Phonegap?