gpt4 book ai didi

javascript - Phonegap navigator.camera.getPicture 内存警告

转载 作者:行者123 更新时间:2023-11-29 10:43:48 30 4
gpt4 key购买 nike

每次我在 iOS 上使用 phonegap API 函数创建图像时,在我点击Use photo 后我都会收到警告。 (内存使用量激增至大约 60MB)

我的代码:

navigator.camera.getPicture(onSuccess, onFail, { quality: 20 });

function onSuccess(imageData) {
console.log('succ');
}

function onFail(message) {
alert('Failed because: ' + message);
}

警告:

2014-05-17 10:56:35.122 Cityfe[1845:60b] Received memory warning.
2014-05-17 10:56:35.195 Cityfe[1845:60b] succ

这有什么值得担心的吗?

最佳答案

试试这个

function getPhoto(source) {
// Retrieve image file location from specified source
navigator.camera.getPicture(onSuccess, onFail, {
quality: 30,
targetWidth: 600,
targetHeight: 600,
destinationType: navigator.camera.DestinationType.FILE_URI,
correctOrientation: true,
sourceType: source
});
}

function onSuccess(imageData) {
console.log('succ');
}

function onFail(message) {
alert('Failed because: ' + message);
}

关于javascript - Phonegap navigator.camera.getPicture 内存警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23709475/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com