Cordova 防止PhoneGap图像库内存不足

Cordova 防止PhoneGap图像库内存不足,cordova,android-camera,out-of-memory,phonegap-plugins,Cordova,Android Camera,Out Of Memory,Phonegap Plugins,我的应用程序(Android)需要从图像库中选择一张照片。选择后,它需要显示在屏幕上。如果我选择一个小图像(例如1024x768),它工作得很好。如果我选择了一张更大的图像(例如一些之前用相机拍摄的图像),应用程序将重新启动并返回到我的index.html,logcat上没有异常 这是我的代码: function getPhoto(source) { navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 1

我的应用程序(Android)需要从图像库中选择一张照片。选择后,它需要显示在屏幕上。如果我选择一个小图像(例如1024x768),它工作得很好。如果我选择了一张更大的图像(例如一些之前用相机拍摄的图像),应用程序将重新启动并返回到我的index.html,logcat上没有异常

这是我的代码:

function getPhoto(source) {
      navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100,
            destinationType : navigator.camera.DestinationType.FILE_URI,
            sourceType:source});
    }
我确信这是一个内存不足的错误。但是对于上面的代码,不需要将图像加载到内存中。phonegap无需调整大小(使用TargetLight…)或纠正方向

我的解决方案快用完了

如果需要:这是onPhotoURISuccess(imageURL)

编辑:

使用此选项进行尝试,也会导致应用程序重新启动:

navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 40,
            destinationType : navigator.camera.DestinationType.FILE_URI,
            sourceType:source, 
            targetWidth:1024, 
            targetHeight:768});
navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 40,
            destinationType : navigator.camera.DestinationType.FILE_URI,
            sourceType:source, 
            targetWidth:1024, 
            targetHeight:768});