//打包APP,cmr.captureImage进行相机拍照,根据决定路径去查找文件,发现图片大小为0kb,再通过plus.zip.compressImage压缩,提示文件不存在。
var cmr = plus.camera.getCamera();
var ts = (new Date()).getTime();
var fileName = ts+".jpg"
var pfsi = new PictureFSInfo(userId,cusId,type,fileName);
var path = pfsi.getSourcePath();
var bpath = pfsi.getBreviaryPath();
cmr.captureImage( function(capturedFile){
console.log( "Capture image success: " + capturedFile );
plus.zip.compressImage({
src:capturedFile,
dst:bpath,
quality:quality
}, function(event){
console.log('压缩成功');
}, function(e){
console.log('压缩失败');
mui.toast(JSON.stringify(e));
});
},
function( error ) {
console.log( "Capture image failed: " + error.message );
mui.toast('拍摄失败!'+error.message);
},
{format:'jpg',filename:path}
);
1 个回复
FullStack - 【插件开发】【专治疑难杂症】【ios上架、马甲包、白包、过审、已成功上架过几百个】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=22130】【非诚勿扰】QQ:543610866
配置 targetSdkVersion 低于 29 的看看