Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ionic3中,限制一张图后,点击相机进行拍照后返回报错 #102

Open
carolinetanxin opened this issue May 21, 2020 · 1 comment

Comments

@carolinetanxin
Copy link

1.使用demo方法
ImagePicker.getPictures(async (result) => {
await this.presentLoading('uploading');
console.log('result is ↓');
console.log(result);
if (result && result.images.length !== 0) {
const imgList = await _.cloneDeep(result.images);
await imgList.forEach(i => {
this.getImgToBase64Code(i.uri);
});
}
}, (err) => {
console.log(err);
console.log('imagePicker Error↑');
}, {
maximumImagesCount : 2,
quality : 50,
enablePickOriginal: false,
});

2.getImgToBase64Code方法
getImgToBase64Code(resFilePath) {
const filePath: string = this.webview.convertFileSrc(resFilePath);
this.base64.encodeFile(filePath).then((base64File: string) => {
this.imgList.push({
attId: null,
fileName: new Date().getTime() + '.jpeg',
base64Code: base64File,
url: filePath,
innerUrl: ''
});
// await setTimeout(() => {
// this.showImgList = false;
// this.closeLoading();
// this.showImgList = true;
// }, 2000);
}, (err) => {
console.log(err);
alert(err);
});
}

3.模拟器中log报错
Received memory pressure event 2 vm pressure 0
2020-05-21 10:45:21.529913+0800 APP[14272:1358689] [GatekeeperXPC] Connection to assetsd was interrupted or assetsd died
2020-05-21 10:45:21.599179+0800 APP[14272:1358604] [ProcessSuspension]  0x28162b2c0 - ProcessAssertion() Unable to acquire assertion for process with PID 0
2020-05-21 10:45:28.040734+0800 APP[14272:1358613] [error] error: XPC: synchronousRemoteObjectProxyWithErrorHandler encountered error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection from pid 0 was invalidated." UserInfo={NSDebugDescription=The connection from pid 0 was invalidated.}
CoreData: error: XPC: synchronousRemoteObjectProxyWithErrorHandler encountered error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection from pid 0 was invalidated." UserInfo={NSDebugDescription=The connection from pid 0 was invalidated.}
2020-05-21 10:45:28.051633+0800 APP[14272:1358613] CoreData: XPC: sendMessage: failed #0
2020-05-21 10:45:28.955553+0800 APP[14272:1357420] location:<+31.26448857,+121.48600270> +/- 1414.00m (speed -1.00 mps / course -1.00) @ 2020/5/21 中国标准时间 10:45:17
2020-05-21 10:45:29.004939+0800 APP[14272:1358989] [ImageManager] First stage of an opportunistic image request returned a non-table format image, this is not fatal, but it is unexpected
2020-05-21 10:45:30.044900+0800 APP[14272:1357420] Luban-iOS image data size before compressed == 6438.629883 Kb
2020-05-21 10:45:30.424797+0800 APP[14272:1357420] Luban-iOS image data size after compressed ==88.625977 kb
2020-05-21 10:45:30.438534+0800 APP[14272:1357420] All finished.
2020-05-21 10:45:32.144812+0800 APP货[14272:1357420] Ionic Native: deviceready event fired after 2526 ms
2020-05-21 10:45:32.153639+0800 APP[14272:1358688]  | JIGUANG | D - [JIGUANGService] Action - setDebugMode

请问有什么解决办法吗?感谢。

@Wgga
Copy link

Wgga commented Oct 12, 2022

ionic How do you use it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants