I have a jquery mobile app (phonegap build). I have a function that will get the uri of an image from the device's photo gallery. I store the uri as a string in local storage so the next time the page is opened, the image displays using the uri. All this works fine (I am not getting the Data-UrI of the image because I don't want to use up the local storage, and I certainly do not want to upload the images to a server due to the app being used in a school (privacy issues). on the device is fine, though. Everything works until I do an update to the app. When the update is installed, the URI to the image changes. How can I get a static URI to the selected picture. Here is the code I use to get the image from the gallery.:
// JavaScript Document //Get Picture stuff
navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50, destinationType:
destinationType.FILE_URI, sourceType:Camera.PictureSourceType.SAVEDPHOTOALBUM});
var pictureSource; // picture source
var destinationType; // sets the format of returned value
pictureSource=navigator.camera.PictureSourceType;
destinationType=navigator.camera.DestinationType;
function onPhotoURISuccess(imageURI) {
// Uncomment to view the image file URI
console.log(imageURI);
localStorage.setItem("piclink", imageURI)
// Get image handle
var largeImage = document.getElementById('largeImage');
// Unhide image elements
largeImage.style.display = 'block';
// Show the captured photo
// The inline CSS rules are used to resize the image
largeImage.src = imageURI;
}
// Called if something bad happens.
function onFail(message) {alert('Failed because: ' + message);
}
I should mention that the update I apply does not make any changes to the camera code. All the data stays in localstorage fine, I can see by the console that it saves and calls the URI with no problem, but in the URI path after update, there is a change in the path (a huge string of numbers and dashes). bTW, there is no problem with the Android version. Any help would be greatly appreciated